aboutsummaryrefslogtreecommitdiff
path: root/src/common-utils/install.sh
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2022-10-06 23:44:43 +0300
committerGitHub <noreply@github.com>2022-10-06 23:44:43 +0300
commit2d63a582d99e3e7b7556ab9bc65b2b1525bf8731 (patch)
tree6a3d97aed45ae4c6e71d152668ff7a1ca05aef53 /src/common-utils/install.sh
parent602c3ec7b642b750a3514705891929f623ea1d35 (diff)
Common-utils: Fix bug - optional first run image specific notice (#201)
* add DEV_CONTAINERS_DIR as containerEnv * fix path * update test * remove containerEnv
Diffstat (limited to 'src/common-utils/install.sh')
-rwxr-xr-xsrc/common-utils/install.sh12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/common-utils/install.sh b/src/common-utils/install.sh
index 0d11532..1170200 100755
--- a/src/common-utils/install.sh
+++ b/src/common-utils/install.sh
@@ -17,9 +17,7 @@ USER_UID=${UID:-"automatic"}
USER_GID=${GID:-"automatic"}
ADD_NON_FREE_PACKAGES=${NONFREEPACKAGES:-"false"}
-DEV_CONTAINERS_DIR="/usr/local/etc/vscode-dev-containers"
-MARKER_FILE="${DEV_CONTAINERS_DIR}/common"
-
+MARKER_FILE="/usr/local/etc/vscode-dev-containers/common"
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.'
@@ -234,8 +232,8 @@ if [[ "${PATH}" != *"$HOME/.local/bin"* ]]; then export PATH="${PATH}:$HOME/.loc
# Display optional first run image specific notice if configured and terminal is interactive
if [ -t 1 ] && [[ "${TERM_PROGRAM}" = "vscode" || "${TERM_PROGRAM}" = "codespaces" ]] && [ ! -f "$HOME/.config/vscode-dev-containers/first-run-notice-already-displayed" ]; then
- if [ -f "${DEV_CONTAINERS_DIR}/first-run-notice.txt" ]; then
- cat "${DEV_CONTAINERS_DIR}/first-run-notice.txt"
+ if [ -f "/usr/local/etc/vscode-dev-containers/first-run-notice.txt" ]; then
+ cat "/usr/local/etc/vscode-dev-containers/first-run-notice.txt"
elif [ -f "/workspaces/.codespaces/shared/first-run-notice.txt" ]; then
cat "/workspaces/.codespaces/shared/first-run-notice.txt"
fi
@@ -432,12 +430,12 @@ if [ ! -z "${CONTENTS_URL}" ]; then echo && echo "More info: ${CONTENTS_URL}"; f
echo
EOF
)"
-if [ -f "${DEV_CONTAINERS_DIR}/meta.env" ]; then
+if [ -f "/usr/local/etc/vscode-dev-containers/meta.env" ]; then
echo "${meta_info_script}" > /usr/local/bin/devcontainer-info
chmod +x /usr/local/bin/devcontainer-info
fi
-if [ ! -d "${DEV_CONTAINERS_DIR}" ]; then
+if [ ! -d "/usr/local/etc/vscode-dev-containers" ]; then
mkdir -p "$(dirname "${MARKER_FILE}")"
fi