Skip to content

Commit 91d02a9

Browse files
authored
Merge pull request #383 from karthik2804/actually_address_pr_comments
actually check in simplified runtime arg creation
2 parents 00cc515 + 5c0ddda commit 91d02a9

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

packages/build-tools/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function getCliArgs(): CliArgs {
3232
type: 'boolean',
3333
})
3434
.option('initLocation', {
35-
describe: 'Location during top level initialization',
35+
describe: 'URL used for the "Location" builtin during top level initialization',
3636
type: 'string',
3737
})
3838
.argv as CliArgs;

packages/build-tools/src/index.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ async function main() {
2626
let CliArgs = getCliArgs();
2727
let src = CliArgs.input;
2828
let outputPath = CliArgs.output;
29-
let runtimeArgs = [
30-
CliArgs.debug && '--enable-script-debugging',
31-
CliArgs.initLocation && `--init-location ${CliArgs.initLocation}`
32-
].filter(Boolean).join(' ');
29+
let runtimeArgs = []
30+
CliArgs.debug && runtimeArgs.push('--enable-script-debugging');
31+
CliArgs.initLocation && runtimeArgs.push(`--init-location ${CliArgs.initLocation}`);
3332

3433
// generate wit world string
3534
let wasiDeps = getPackagesWithWasiDeps(process.cwd(), new Set(), true);
@@ -64,7 +63,7 @@ async function main() {
6463

6564
let inlineWitChecksum = await calculateChecksum(inlineWit);
6665
// Small optimization to skip componentization if the source file hasn't changed
67-
if (!(await ShouldComponentize(src, outputPath, componentizeVersion, runtimeArgs, inlineWitChecksum))) {
66+
if (!(await ShouldComponentize(src, outputPath, componentizeVersion, runtimeArgs.join(" "), inlineWitChecksum))) {
6867
console.log(
6968
'No changes detected in source file and target World. Skipping componentization.',
7069
);
@@ -99,7 +98,7 @@ async function main() {
9998
sourcePath: precompiledSourcePath,
10099
// @ts-ignore
101100
witWorld: inlineWit,
102-
runtimeArgs,
101+
runtimeArgs: runtimeArgs.join(" "),
103102
enableAot: CliArgs.aot,
104103
});
105104

@@ -110,7 +109,7 @@ async function main() {
110109
getBuildDataPath(src),
111110
await calculateChecksum(await readFile(src)),
112111
componentizeVersion,
113-
runtimeArgs,
112+
runtimeArgs.join(" "),
114113
inlineWitChecksum,
115114
);
116115

0 commit comments

Comments
 (0)