aboutsummaryrefslogtreecommitdiff
path: root/src/hugo
diff options
context:
space:
mode:
authoreitsupi <50911393+eitsupi@users.noreply.github.com>2022-10-11 01:33:01 +0300
committerGitHub <noreply@github.com>2022-10-11 01:33:01 +0300
commita8cb375d460840bbf8c91599d16fc87d9ee8b996 (patch)
tree73dd647775325582c17a452816457f5cec82004d /src/hugo
parent065b5ec9e19d4f289a070c3d5337696fd2394dc0 (diff)
Ensure remove apt-update cache at the beginning and end of the scripts (#210)
* remove apt lists * bump versions
Diffstat (limited to 'src/hugo')
-rw-r--r--src/hugo/devcontainer-feature.json2
-rwxr-xr-xsrc/hugo/install.sh12
2 files changed, 11 insertions, 3 deletions
diff --git a/src/hugo/devcontainer-feature.json b/src/hugo/devcontainer-feature.json
index 2303397..b08a51c 100644
--- a/src/hugo/devcontainer-feature.json
+++ b/src/hugo/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "hugo",
- "version": "1.0.4",
+ "version": "1.0.5",
"name": "Hugo",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/hugo",
"options": {
diff --git a/src/hugo/install.sh b/src/hugo/install.sh
index 62c0724..778b552 100755
--- a/src/hugo/install.sh
+++ b/src/hugo/install.sh
@@ -16,6 +16,9 @@ HUGO_DIR=${HUGO_DIR:-"/usr/local/hugo"}
set -e
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
@@ -63,8 +66,10 @@ updaterc() {
apt_get_update()
{
- echo "Running apt-get update..."
- apt-get update -y
+ if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
+ echo "Running apt-get update..."
+ apt-get update -y
+ fi
}
# Checks if packages are installed and installs them if not
@@ -114,4 +119,7 @@ if ! hugo version &> /dev/null ; then
find "${HUGO_DIR}" -type d -print0 | xargs -n 1 -0 chmod g+s
fi
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
echo "Done!"