aboutsummaryrefslogtreecommitdiff
path: root/src/dotnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotnet')
-rw-r--r--src/dotnet/devcontainer-feature.json2
-rwxr-xr-xsrc/dotnet/install.sh14
2 files changed, 13 insertions, 3 deletions
diff --git a/src/dotnet/devcontainer-feature.json b/src/dotnet/devcontainer-feature.json
index 5d9b0f3..2d261eb 100644
--- a/src/dotnet/devcontainer-feature.json
+++ b/src/dotnet/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "dotnet",
- "version": "1.0.6",
+ "version": "1.0.7",
"name": "Dotnet CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/dotnet",
"description": "Installs the .NET CLI. Provides option of installing sdk or runtime, and option of versions to install. Uses latest version of .NET sdk as defaults to install.",
diff --git a/src/dotnet/install.sh b/src/dotnet/install.sh
index d9399ca..fe4f58d 100755
--- a/src/dotnet/install.sh
+++ b/src/dotnet/install.sh
@@ -30,6 +30,11 @@ DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1="buster bullseye bionic focal hi
# alongside DOTNET_VERSION, but not set as default.
ADDITIONAL_VERSIONS=${ADDITIONALVERSIONS:-""}
+set -e
+
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
# Setup STDERR.
err() {
echo "(!) $*" >&2
@@ -109,8 +114,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
}
# Check if packages are installed and installs them if not.
@@ -463,4 +470,7 @@ if [ "${CHANGE_OWNERSHIP}" = "true" ]; then
find "${TARGET_DOTNET_ROOT}" -type d -print0 | xargs -n 1 -0 chmod g+s
fi
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
echo "Done!"