diff options
Diffstat (limited to 'src/git-lfs')
-rw-r--r-- | src/git-lfs/devcontainer-feature.json | 2 | ||||
-rwxr-xr-x | src/git-lfs/install.sh | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/git-lfs/devcontainer-feature.json b/src/git-lfs/devcontainer-feature.json index 0f075ca..f67376e 100644 --- a/src/git-lfs/devcontainer-feature.json +++ b/src/git-lfs/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "git-lfs", - "version": "1.0.2", + "version": "1.0.3", "name": "Git Large File Support (LFS)", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/git-lfs", "description": "Installs Git Large File Support (Git LFS) along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like git and curl.", diff --git a/src/git-lfs/install.sh b/src/git-lfs/install.sh index d88a379..f24ed92 100755 --- a/src/git-lfs/install.sh +++ b/src/git-lfs/install.sh @@ -19,6 +19,9 @@ keyserver hkp://keyserver.pgp.com" 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 @@ -107,8 +110,10 @@ receive_gpg_keys() { 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 @@ -178,8 +183,7 @@ export DEBIAN_FRONTEND=noninteractive . /etc/os-release check_packages curl ca-certificates gnupg2 dirmngr apt-transport-https if ! type git > /dev/null 2>&1; then - apt_get_update - apt-get -y install --no-install-recommends git + check_packages git fi if [ "${ID}" = "debian" ]; then check_packages debian-archive-keyring @@ -199,4 +203,7 @@ if [ "${use_github}" = "true" ]; then install_using_github fi -echo "Done!"
\ No newline at end of file +# Clean up +rm -rf /var/lib/apt/lists/* + +echo "Done!" |