fix: honor learning player artifact output path

This commit is contained in:
inman
2026-08-17 09:58:04 +08:00
parent f0636ab51b
commit 0b4c45d696

View File

@@ -5,7 +5,11 @@ import process from 'node:process';
const variant = process.argv[2];
if (variant !== 'engine' && variant !== 'ops' && variant !== 'player') {
throw new Error('Usage: node scripts/build-learning-artifact.mjs <engine|ops|player>');
throw new Error('Usage: node scripts/build-learning-artifact.mjs <engine|ops|player> [output-directory]');
}
const explicitOutput = process.argv[3];
if (explicitOutput && variant !== 'player') {
throw new Error('An explicit output directory is only supported for the player artifact');
}
const root = process.cwd();
@@ -39,7 +43,10 @@ run(path.join(root, 'scripts/assert-vendor-maic-importer.mjs'));
run(path.join(root, 'node_modules/next/dist/bin/next'), ['build', '--webpack']);
if (variant === 'player') {
run(path.join(root, 'scripts/build-makelore-player-artifact.mjs'));
run(
path.join(root, 'scripts/build-makelore-player-artifact.mjs'),
explicitOutput ? [path.resolve(explicitOutput)] : [],
);
console.log('Learning player build completed from a fresh learner-role Next output.');
process.exit(0);
}