From d5e345fb48340248bcdefcf14da824ff8a49c7c1 Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Tue, 29 Aug 2023 12:56:31 +0000 Subject: [PATCH] Adding to bash the functionality to install extensions from array. Updating to version 1.0.15 --- entrypoint.sh | 17 +++++++++++++++++ version.txt | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 67856a1..0ea3949 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,6 +7,23 @@ addgroup nonroot adduser --disabled-password --gecos "" ${HOME_USER} echo "${HOME_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +# Check if the data.json file exists +if [ -f "/home/extensions.json" ]; then + # Read the JSON file into a variable + jsonExtensions=$(cat /home/extensions.json) + + # Use jq to extract the array elements + extensions=$(echo $jsonExtensions | jq -r '.[]') + + # Loop through the extensions and process each element + for extension in $extensions; do + echo "Installing extension: $extension" + sudo su - ${HOME_USER} -c "code --install-extension $extension" + done +else + echo "File extensions.json not found" +fi + if [[ -z "${VSCODE_TUNNEL_NAME}" ]]; then sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms" else diff --git a/version.txt b/version.txt index 97bceaa..758a46e 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.14 \ No newline at end of file +1.0.15 \ No newline at end of file