Skip to content

Commit 2aff1dc

Browse files
committed
packager: fix Linux launcher wrapper quoting
Add CD validation to catch malformed wrapper scripts early.
1 parent 208d6d3 commit 2aff1dc

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/cd.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ jobs:
110110
env:
111111
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112112

113+
- name: Validate Linux launcher wrapper
114+
if: matrix.platform == 'linux'
115+
run: |
116+
launcher_path=build/dist/linux-unpacked/SpringBoard
117+
test -f "$launcher_path"
118+
sh -n "$launcher_path"
119+
if grep -q '\\\\"' "$launcher_path"; then
120+
echo "Invalid escaped quotes found in launcher wrapper: $launcher_path"
121+
exit 1
122+
fi
123+
113124
- name: Upload build artifacts
114125
uses: actions/upload-artifact@v6
115126
with:

build/sbc_packager/assets/sbc_after_pack.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = async function sbcAfterPack(context) {
2121

2222
const wrapper = `#!/bin/sh
2323
set -eu
24-
APPDIR="$(CDPATH= cd -- \\"$(dirname -- \\"$0\\")\\" && pwd)"
24+
APPDIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
2525
exec "$APPDIR/${executableName}-bin" --no-sandbox --disable-setuid-sandbox "$@"
2626
`;
2727

0 commit comments

Comments
 (0)