{"record":{"id":"b0aba612387eb3f2","repo":"Hmbown/CodeWhale","slug":"usage-node-scripts-release-assemble-release-ass","errorCode":null,"errorMessage":"Usage:\n  node scripts/release/assemble-release-assets.js INPUT_DIR OUTPUT_DIR\n  node scripts/release/assemble-release-assets.js --verify ASSET_DIR","messagePattern":"Usage:\n  node scripts/release/assemble-release-assets\\.js INPUT_DIR OUTPUT_DIR\n  node scripts/release/assemble-release-assets\\.js --verify ASSET_DIR","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"info","filePath":"scripts/release/assemble-release-assets.js","lineNumber":171,"sourceCode":"  );\n\n  const checksumRows = [];\n  for (const name of [...checksummedReleaseAssetNames()].sort()) {\n    checksumRows.push(`${await sha256(path.join(outputDirectory, name))}  ${name}`);\n  }\n  await fs.writeFile(\n    path.join(outputDirectory, CHECKSUM_MANIFEST),\n    `${checksumRows.join(\"\\n\")}\\n`,\n    \"utf8\",\n  );\n\n  await verifyAssetDirectory(outputDirectory);\n}\n\nasync function main() {\n  if (process.argv[2] === \"--verify\") {\n    if (process.argv.length !== 4) {\n      throw new Error(usage());\n    }\n    await verifyAssetDirectory(path.resolve(process.argv[3]));\n    return;\n  }\n  if (process.argv.length !== 4) {\n    throw new Error(usage());\n  }\n  await assemble(path.resolve(process.argv[2]), path.resolve(process.argv[3]));\n}\n\nif (require.main === module) {\n  main().catch((error) => {\n    console.error(`Release asset assembly failed: ${error.message}`);\n    process.exit(1);\n  });\n}\n\nmodule.exports = {","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/scripts/release/assemble-release-assets.js#L153-L189","documentation":"CLI usage guard in main(): the script was started with --verify as the first argument but the total argv length is not exactly 4, i.e. the asset directory argument is missing or extra arguments were passed. The two supported invocation forms are printed and the top-level handler exits 1 with 'Release asset assembly failed: ...'.","triggerScenarios":"node scripts/release/assemble-release-assets.js --verify (directory omitted); --verify DIR extra-arg (length 5); --verify given as the third positional after something else.","commonSituations":"Copy-pasting the command without substituting the placeholder; scripts appending default flags the tool does not parse; invoking with extra quoting that shifts argv positions.","solutions":["Invoke exactly: node scripts/release/assemble-release-assets.js --verify ASSET_DIR","If wrapping the script, pass arguments as an array (execFile-style) to avoid quoting surprises"],"exampleFix":"# before\nnode scripts/release/assemble-release-assets.js --verify\n\n# after\nnode scripts/release/assemble-release-assets.js --verify ./release-out","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\nif [ \"$#\" -ne 2 ] || [ \"$1\" != \"--verify\" ]; then\n  echo \"usage: $0 --verify ASSET_DIR\" >&2; exit 2;\nfi\nexec node scripts/release/assemble-release-assets.js \"$1\" \"$2\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wrap the script in your own entry point that checks argument count before delegating","Invoke with execFile-style argument arrays to avoid shell quoting shifting positions"],"tags":["cli","usage","release","nodejs"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}