diff --git a/src/scripts/common.sh b/src/scripts/common.sh index a699bd928..dc478ef86 100755 --- a/src/scripts/common.sh +++ b/src/scripts/common.sh @@ -93,19 +93,15 @@ ensure_pnpm_setup() if [ -z "$PNPM_HOME" ]; then report_status "Creating pnpm home directory..." sudo -u "${RATOS_USERNAME}" pnpm setup - # Extract PNPM_HOME directly from .bashrc - PNPM_HOME=$(sudo -u "${RATOS_USERNAME}" grep "export PNPM_HOME=" "${REAL_HOME}/.bashrc" | cut -d'"' -f2) - export PNPM_HOME fi + # Extract PNPM_HOME directly from .bashrc + PNPM_HOME=$(sudo -u "${RATOS_USERNAME}" grep "export PNPM_HOME=" "${REAL_HOME}/.bashrc" | cut -d'"' -f2) if [ -n "$PNPM_HOME" ] && [ ! -d "$PNPM_HOME" ]; then report_status "PNPM home directory '${PNPM_HOME}' not found, creating..." mkdir -p "$PNPM_HOME" sudo chown -R "${RATOS_USERNAME}:${RATOS_USERNAME}" "$PNPM_HOME" fi -} - -install_global_pnpm_packages() -{ + # Install global packages if ! which zx &> /dev/null; then report_status "Installing global pnpm package requirements..." # Pass PNPM_HOME to the subshell @@ -113,6 +109,7 @@ install_global_pnpm_packages() fi } + ensure_service_permission() { if ! grep -q "ratos-configurator" "${RATOS_PRINTER_DATA_DIR}/moonraker.asvc"; then diff --git a/src/scripts/update.sh b/src/scripts/update.sh index 76c51f067..4432318cf 100755 --- a/src/scripts/update.sh +++ b/src/scripts/update.sh @@ -32,7 +32,6 @@ ensure_sudo_command_whitelisting ensure_pnpm_installation pnpm_install ensure_pnpm_setup -install_global_pnpm_packages install_cli install_udev_rule patch_log_rotation