aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2022-05-27 02:18:51 +0300
committerGitHub <noreply@github.com>2022-05-27 02:18:51 +0300
commit3f74eb316c511f53c4d6fd8d3a925b1153f8e48b (patch)
treedc425e64c3022a37eff7865388fabcfde4f496e8
parent2d5ba904bce84c63a632f0d51325621d2ff46847 (diff)
fix php: add missing $ (#28)
* fix php: add missing $ * test fix * fix user
-rw-r--r--src/php/install.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/php/install.sh b/src/php/install.sh
index 4d4d211..aee5d8d 100644
--- a/src/php/install.sh
+++ b/src/php/install.sh
@@ -28,7 +28,7 @@ rm -f /etc/profile.d/00-restore-env.sh
echo "export PATH=${PATH//$(sh -lc 'echo $PATH')/\$PATH}" > /etc/profile.d/00-restore-env.sh
chmod +x /etc/profile.d/00-restore-env.sh
-# Determine the appropriate non-root user
+# If in automatic mode, determine if a user already exists, if not use vscode
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
USERNAME=""
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
@@ -39,10 +39,12 @@ if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
fi
done
if [ "${USERNAME}" = "" ]; then
- USERNAME=root
+ USERNAME=vscode
fi
-elif [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then
+elif [ "${USERNAME}" = "none" ]; then
USERNAME=root
+ USER_UID=0
+ USER_GID=0
fi
architecture="$(uname -m)"
@@ -157,7 +159,7 @@ if ! php --version &> /dev/null ; then
# Install xdebug
pecl install xdebug
XDEBUG_INI="$CONF_DIR/xdebug.ini"
- echo "zend_extension=$(find PHP_EXT_DIR -name xdebug.so)" > XDEBUG_INI
+ echo "zend_extension=$(find $PHP_EXT_DIR -name xdebug.so)" > XDEBUG_INI
echo "xdebug.mode = debug" >> XDEBUG_INI
echo "xdebug.start_with_request = yes" >> XDEBUG_INI
echo "xdebug.client_port = 9003" >> XDEBUG_INI