From d1a67a1a20e883d94762f6194b28a12bbb5dd6be Mon Sep 17 00:00:00 2001 From: cirolosapio Date: Tue, 9 Apr 2024 10:20:42 +0000 Subject: [PATCH] Update devcontainer-feature.json version to 0.0.11 --- src/alpine-gh-copilot-cli/devcontainer-feature.json | 2 +- src/alpine-gh-copilot-cli/install.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/alpine-gh-copilot-cli/devcontainer-feature.json b/src/alpine-gh-copilot-cli/devcontainer-feature.json index 6995c8a..a273cca 100644 --- a/src/alpine-gh-copilot-cli/devcontainer-feature.json +++ b/src/alpine-gh-copilot-cli/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "alpine-gh-copilot-cli", "id": "alpine-gh-copilot-cli", - "version": "0.0.10", + "version": "0.0.11", "description": "Installs Github Copilot CLI on alpine", "documentationURL": "https://github.com/cirolosapio/devcontainers-features/tree/main/src/alpine-gh-copilot-cli", "installsAfter": [ diff --git a/src/alpine-gh-copilot-cli/install.sh b/src/alpine-gh-copilot-cli/install.sh index 4282662..482aa3e 100644 --- a/src/alpine-gh-copilot-cli/install.sh +++ b/src/alpine-gh-copilot-cli/install.sh @@ -10,11 +10,13 @@ npm i -g @githubnext/github-copilot-cli if [[ $INITALIAS == "true" ]]; then CURRENT_USER=$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd) echo "CURRENT_USER is $CURRENT_USER" - + echo "_CONTAINER_USER_HOME is $_CONTAINER_USER_HOME" + if [[ -z $CURRENT_USER ]]; then echo 'eval "$(github-copilot-cli alias -- "$0")"' >> $_CONTAINER_USER_HOME/.zshrc else - su -c `echo 'eval "$(github-copilot-cli alias -- "$0")"' >> $_CONTAINER_USER_HOME/.zshrc` $CURRENT_USER + CMD="echo 'eval \"\$(github-copilot-cli alias -- \"\$0\")\"' >> \$_CONTAINER_USER_HOME/.zshrc" + su -c "$CMD" $CURRENT_USER fi fi