fix: remove bash syntax errors in installer script

- Remove 'local' keyword usage outside of functions
- Variables should_update_deps, current_express_ver, and express_version are now global
- Fixes "./install-pulse.sh: line 2204: local: can only be used in a function" error

This was preventing the dependency update logic from running properly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
courtmanr@gmail.com
2025-05-31 14:56:18 +01:00
parent 6f09488864
commit defc925e3b
+3 -3
View File
@@ -2201,11 +2201,11 @@ case "$INSTALL_MODE" in
# Always update dependencies on updates to ensure package changes are applied
# Skip only for fresh installs with tarball
local should_update_deps=true
should_update_deps=true
if [ "$TARBALL_INSTALL_SUCCESS" = "true" ] && [ "$INSTALL_MODE" = "install" ]; then
# Even for tarball installs, check if Express version is correct
cd "$PULSE_DIR" || { print_error "Failed to cd to $PULSE_DIR"; exit 1; }
local current_express_ver=$(npm list express --depth=0 2>/dev/null | grep express@ | sed 's/.*express@//' || echo "")
current_express_ver=$(npm list express --depth=0 2>/dev/null | grep express@ | sed 's/.*express@//' || echo "")
if [[ "$current_express_ver" == "4.19.2" ]]; then
print_info "Skipping npm install for fresh tarball installation with correct dependencies."
should_update_deps=false
@@ -2245,7 +2245,7 @@ case "$INSTALL_MODE" in
fi
# Verify Express version
local express_version=$(npm list express --depth=0 2>/dev/null | grep express@ | sed 's/.*express@//')
express_version=$(npm list express --depth=0 2>/dev/null | grep express@ | sed 's/.*express@//')
if [ -n "$express_version" ]; then
print_info "Express version installed: $express_version"
fi