From 56dbdd9a5e622d0cdd6da43679d3f2e76b8d21fe Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Wed, 20 Aug 2025 23:22:42 +0000 Subject: [PATCH] fix: move WORKSPACE_ARG logic inside function to avoid template variable error Fixes test failures by ensuring WORKSPACE_ARG is defined within the function scope rather than as a global template variable. --- registry/coder/modules/vscode-web/run.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/registry/coder/modules/vscode-web/run.sh b/registry/coder/modules/vscode-web/run.sh index e7e18db0..6fc6e7ed 100644 --- a/registry/coder/modules/vscode-web/run.sh +++ b/registry/coder/modules/vscode-web/run.sh @@ -22,15 +22,15 @@ if [ "${DISABLE_TRUST}" = true ]; then DISABLE_TRUST_ARG="--disable-workspace-trust" fi -# Set workspace or folder argument -WORKSPACE_ARG="" -if [ -n "${WORKSPACE}" ]; then - WORKSPACE_ARG="${WORKSPACE}" -elif [ -n "${FOLDER}" ]; then - WORKSPACE_ARG="${FOLDER}" -fi - run_vscode_web() { + # Determine what to pass as the workspace argument + WORKSPACE_ARG="" + if [ -n "${WORKSPACE}" ]; then + WORKSPACE_ARG="${WORKSPACE}" + elif [ -n "${FOLDER}" ]; then + WORKSPACE_ARG="${FOLDER}" + fi + echo "👷 Running $VSCODE_WEB serve-local with workspace: ${WORKSPACE_ARG}" echo "Check logs at ${LOG_PATH}!" "$VSCODE_WEB" serve-local "$EXTENSION_ARG" "$SERVER_BASE_PATH_ARG" "$DISABLE_TRUST_ARG" --port "${PORT}" --host 127.0.0.1 --accept-server-license-terms --without-connection-token --telemetry-level "${TELEMETRY_LEVEL}" "${WORKSPACE_ARG}" > "${LOG_PATH}" 2>&1 &