diff options
author | Josh Spicer <joshspicer@github.com> | 2022-08-23 16:17:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 16:17:08 +0300 |
commit | 0cafeee86296b9f19e6425055e0c4037eff41985 (patch) | |
tree | 1320a7b4c79a9a676e30632117bbd5a955b673ba /src/hugo | |
parent | 58e425039a1dc78cde64e9c1939e2a3dfed6d22a (diff) |
favor correctness by removing `apt update ...` short-circuiting (#98)
* favor correctness by removing apt update shortciruiting
* Update install.sh
* apt_get_upadate in node
* update test
Diffstat (limited to 'src/hugo')
-rwxr-xr-x | src/hugo/install.sh | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/hugo/install.sh b/src/hugo/install.sh index f7ab7a2..0ccc294 100755 --- a/src/hugo/install.sh +++ b/src/hugo/install.sh @@ -61,21 +61,16 @@ updaterc() { fi } -# Function to run apt-get if needed -apt_get_update_if_needed() +apt_get_update() { - if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then - echo "Running apt-get update..." - apt-get update - else - echo "Skipping apt-get update." - fi + echo "Running apt-get update..." + apt-get update -y } # Checks if packages are installed and installs them if not check_packages() { if ! dpkg -s "$@" > /dev/null 2>&1; then - apt_get_update_if_needed + apt_get_update apt-get -y install --no-install-recommends "$@" fi } |