Skip to content

[WIP] Fix undefined variable $app_name in bundle.ps1#11

Closed
BunsDev with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-undefined-variable-app-name
Closed

[WIP] Fix undefined variable $app_name in bundle.ps1#11
BunsDev with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-undefined-variable-app-name

Conversation

Copilot AI commented May 14, 2026

Copy link
Copy Markdown

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt
Please apply the following diffs and create a pull request.
Once the PR is ready, give it a title based on the messages of the fixes being applied.

[{"message":"Variable `$app_name` is used before it is defined. At this point in the script, `$APP_NAME` (uppercase) is not yet set. This line should be moved to after line 119 where `$APP_NAME` is properly defined based on the channel, or the variable reference should be removed if this assignment is intended to be overwritten later.","fixFiles":[{"filePath":"script/windows/bundle.ps1","diff":"diff --git a/script/windows/bundle.ps1 b/script/windows/bundle.ps1\n--- a/script/windows/bundle.ps1\n+++ b/script/windows/bundle.ps1\n@@ -79,7 +79,6 @@\n } else {\n     $CARGO_TARGET_OUTPUT_DIR = \"$CARGO_TARGET_DIR\" + '\\' + $PLATFORM_TARGET + '\\' + \"$CARGO_PROFILE\"\n }\n-$BUNDLE_ID = \"dev.castcodes.$app_name\"\n \n # Update parameters based on the target release channel.\n #\n"}]},{"message":"The variable `$BUNDLE_ID` is assigned twice in the script (lines 82 and 122). The first assignment on line 82 uses an undefined variable and should be removed to eliminate confusion and potential bugs.","fixFiles":[{"filePath":"script/windows/bundle.ps1","diff":"diff --git a/script/windows/bundle.ps1 b/script/windows/bundle.ps1\n--- a/script/windows/bundle.ps1\n+++ b/script/windows/bundle.ps1\n@@ -119,7 +119,7 @@\n }\n \n $BINARY_PATH = \"$CARGO_TARGET_OUTPUT_DIR\\$BINARY_NAME\"\n-$BUNDLE_ID = \"dev.castcodes.$APP_NAME\"\n+\n $INSTALLER_OUTPUT_DIR = \"$WINDOWS_INSTALLER_DIR\\Output\"\n $INSTALLER_NAME = \"$($APP_NAME)$($FILE_ENDING)\"\n $INSTALLER_PATH = \"$($INSTALLER_OUTPUT_DIR)\\$($INSTALLER_NAME).exe\"\n"}]}]

@BunsDev

BunsDev commented May 15, 2026

Copy link
Copy Markdown
Member

Superseded by #15 which implements all four fixes.

@BunsDev BunsDev closed this May 15, 2026
BunsDev added a commit that referenced this pull request May 15, 2026
…et -e, remove deprecated ::echo:: commands (#15)

- bundle.ps1: remove premature $BUNDLE_ID assignment using undefined $app_name (fixes #11)
- install_build_deps: guard /etc/os-release source with file existence check (fixes #13)
- install_cargo_bundle: move set -e to top of script so all failures are caught (fixes #14)
- Grammatical fix in wasm/bundle comment (fixes #12)
- Remove deprecated ::echo::on/off GitHub Actions commands from all bundle scripts and workflows (fixes #12)
@BunsDev
BunsDev deleted the copilot/fix-undefined-variable-app-name branch June 15, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants