mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-10 04:19:25 -07:00
Fix track-probe fake yt-dlp shell script for CI
- Use #!/bin/sh instead of #!/usr/bin/env sh (avoids PATH dependency) - Set minimal PATH inside script for base64/cat commands - Fix base64 content encoding: use stdoutBody directly instead of JSON.stringify(stdoutBody) which double-encoded the output - Use unique heredoc delimiter to avoid conflicts with content
This commit is contained in:
@@ -24,10 +24,11 @@ function makeFakeYtDlpScript(dir: string, payload: unknown, rawScript = false):
|
||||
: `#!/usr/bin/env bun
|
||||
process.stdout.write(${JSON.stringify(stdoutBody)});
|
||||
`
|
||||
: `#!/usr/bin/env sh
|
||||
cat <<'EOF' | base64 -d
|
||||
${Buffer.from(rawScript ? stdoutBody : `${JSON.stringify(stdoutBody)}`).toString('base64')}
|
||||
EOF
|
||||
: `#!/bin/sh
|
||||
PATH=/usr/bin:/bin:/usr/local/bin
|
||||
cat <<'SUBMINER_EOF' | base64 -d
|
||||
${Buffer.from(stdoutBody).toString('base64')}
|
||||
SUBMINER_EOF
|
||||
`;
|
||||
fs.writeFileSync(scriptPath, script, 'utf8');
|
||||
if (process.platform !== 'win32') {
|
||||
|
||||
Reference in New Issue
Block a user