summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/sandbox_command.sh6
-rwxr-xr-xscripts/setup-dev.sh14
2 files changed, 5 insertions, 15 deletions
diff --git a/scripts/sandbox_command.sh b/scripts/sandbox_command.sh
index 61dd3178..7c140c61 100755
--- a/scripts/sandbox_command.sh
+++ b/scripts/sandbox_command.sh
@@ -32,11 +32,11 @@ done
shift $((OPTIND - 1))
# if GEMINI_SANDBOX is not set, see if it is set in user settings
-# note it can be string or boolean, and if missing jq will return null
+# note it can be string or boolean, and if missing `npx json` will return empty string
USER_SETTINGS_FILE="$HOME/.gemini/settings.json"
if [ -z "${GEMINI_SANDBOX:-}" ] && [ -f "$USER_SETTINGS_FILE" ]; then
- USER_SANDBOX_SETTING=$(sed -e 's/\/\/.*//' -e 's/\/\*.*\*\///g' -e '/^[[:space:]]*\/\//d' "$USER_SETTINGS_FILE" | jq -r '.sandbox')
- if [ "$USER_SANDBOX_SETTING" != null ]; then
+ USER_SANDBOX_SETTING=$(sed -e 's/\/\/.*//' -e 's/\/\*.*\*\///g' -e '/^[[:space:]]*\/\//d' "$USER_SETTINGS_FILE" | npx json 'sandbox')
+ if [ -n "$USER_SANDBOX_SETTING" ]; then
GEMINI_SANDBOX=$USER_SANDBOX_SETTING
fi
fi
diff --git a/scripts/setup-dev.sh b/scripts/setup-dev.sh
index f8d0bf13..de2ae336 100755
--- a/scripts/setup-dev.sh
+++ b/scripts/setup-dev.sh
@@ -16,8 +16,7 @@
set -euo pipefail
# Check if npm is installed
-if ! command -v npm &> /dev/null
-then
+if ! command -v npm &>/dev/null; then
echo "npm not found. Installing npm via nvm..."
# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
@@ -26,19 +25,10 @@ then
# Download and install Node.js:
nvm install 22
# Verify the Node.js version:
- node -v # Should print "v22.15.0".
+ node -v # Should print "v22.15.0".
nvm current # Should print "v22.15.0".
# Verify npm version:
npm -v # Should print "10.9.2".
fi
-# Check if jq is installed
-if ! command -v jq &> /dev/null
-then
- echo "jq not found. Installing jq..."
- # This assumes a Debian/Ubuntu based system. Adjust for other distributions.
- sudo apt-get update
- sudo apt-get install -y jq
-fi
-
echo "Development environment setup complete."