patch: fix sidecar build for windows

This commit is contained in:
Edwin Joassart 2023-12-01 19:10:08 +01:00
parent 8c52350588
commit a61652a0b8

View File

@ -62,7 +62,7 @@ function build(
const commands: Array<[string, string[]]> = [ const commands: Array<[string, string[]]> = [
[ [
'tsc', 'tsc',
['--project', 'tsconfig.sidecar.json', '--outDir', `'${sourcesDir}'`], ['--project', 'tsconfig.sidecar.json', '--outDir', `${sourcesDir}`],
], ],
]; ];
@ -77,7 +77,7 @@ function build(
commands.push([ commands.push([
'pkg', 'pkg',
[ [
`'${path.join(sourcesDir, 'util', 'api.js')}'`, `${path.join(sourcesDir, 'util', 'api.js')}`,
'-c', '-c',
'pkg-sidecar.json', 'pkg-sidecar.json',
// `--no-bytecode` so that we can cross-compile for arm64 on x64 // `--no-bytecode` so that we can cross-compile for arm64 on x64
@ -89,16 +89,18 @@ function build(
'--target', '--target',
arch, arch,
'--output', '--output',
`'${binPath}'`, `${binPath}`,
], ],
]); ]);
commands.push(['ls', ['-alFR', `'${binDir}'`]]); //commands.push(['ls', ['-alFR', `'${binDir}'`]]);
}); });
commands.forEach(([cmd, args]) => { commands.forEach(([cmd, args]) => {
debug('running command:', cmd, args.join(' ')); debug('running command:', cmd, args.join(' '));
execFileSync(cmd, args, { shell: 'bash', stdio: 'inherit' }); try {
execFileSync(cmd, args, { shell: true, stdio: 'inherit' });
} catch (error) {console.log(error)}
}); });
} }