{"record":{"id":"5fd424e36dd332c4","repo":"Hmbown/CodeWhale","slug":"codewhale-smoke-assets-dir-is-not-a-directory","errorCode":null,"errorMessage":"CODEWHALE_SMOKE_ASSETS_DIR is not a directory: ${releaseAssetsDir}","messagePattern":"CODEWHALE_SMOKE_ASSETS_DIR is not a directory: (.+?)","errorType":"console","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/release/npm-wrapper-smoke.js","lineNumber":172,"sourceCode":"  ).trim();\n  const releaseAssetsDir = suppliedAssetsDir\n    ? path.resolve(suppliedAssetsDir)\n    : path.join(tempRoot, \"release-assets\");\n  const packDir = path.join(tempRoot, \"pack\");\n  const installDir = path.join(tempRoot, \"install\");\n  let keepTemp =\n    process.env.CODEWHALE_KEEP_SMOKE_DIR === \"1\" ||\n    process.env.DEEPSEEK_TUI_KEEP_SMOKE_DIR === \"1\";\n  let server;\n\n  try {\n    await fsp.mkdir(packDir, { recursive: true });\n    await fsp.mkdir(installDir, { recursive: true });\n\n    if (suppliedAssetsDir) {\n      const assetDirectoryStat = await fsp.stat(releaseAssetsDir);\n      if (!assetDirectoryStat.isDirectory()) {\n        throw new Error(`CODEWHALE_SMOKE_ASSETS_DIR is not a directory: ${releaseAssetsDir}`);\n      }\n      console.log(`Using preassembled release assets from ${releaseAssetsDir}`);\n    } else {\n      const prepareArgs = [prepareAssetsScript, releaseAssetsDir];\n      const cargoTargetDir = String(process.env.CARGO_TARGET_DIR || \"\").trim();\n      if (cargoTargetDir) {\n        prepareArgs.push(\n          path.join(path.resolve(repoRoot, cargoTargetDir), \"release\"),\n        );\n      }\n      await runCommand(process.execPath, prepareArgs);\n    }\n    const served = await serveDirectory(releaseAssetsDir);\n    server = served.server;\n\n    const env = {\n      CODEWHALE_FORCE_DOWNLOAD: \"1\",\n      CODEWHALE_RELEASE_BASE_URL: served.baseUrl,","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/release/npm-wrapper-smoke.js#L154-L190","documentation":"main() in the npm wrapper smoke script accepts a preassembled release-assets directory via CODEWHALE_SMOKE_ASSETS_DIR. If the variable is set but the path is not a directory, the script aborts rather than silently building assets.","triggerScenarios":"CODEWHALE_SMOKE_ASSETS_DIR points to a file, a nonexistent path caught earlier as a stat error, or an empty string that survives the truthiness check via whitespace, and fsp.stat confirms it is not a directory.","commonSituations":"Typo in the path in CI secrets; pointing the variable at the tarball file instead of the directory of release assets; leftover path from a previous checkout layout.","solutions":["Set CODEWHALE_SMOKE_ASSETS_DIR to the directory containing the preassembled release assets, not a file.","Verify the path exists with `ls -d \"$CODEWHALE_SMOKE_ASSETS_DIR\"` before running the smoke script.","Unset the variable to let the script assemble assets itself via the prepare script."],"exampleFix":"// before\nexport CODEWHALE_SMOKE_ASSETS_DIR=target/release/codewhale.tar.gz\n// after\nexport CODEWHALE_SMOKE_ASSETS_DIR=target/release-assets","handlingStrategy":"validation","validationCode":"const dir = process.env.CODEWHALE_SMOKE_ASSETS_DIR;\nif (dir) {\n  const st = await fsp.stat(dir);\n  if (!st.isDirectory()) throw new Error(`not a directory: ${dir}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await main();\n} catch (err) {\n  if (String(err.message).includes(\"CODEWHALE_SMOKE_ASSETS_DIR\")) {\n    console.error(\"Check the assets dir path; it must be a directory, not a file.\");\n  }\n  process.exitCode = 1;\n}","preventionTips":["Point CODEWHALE_SMOKE_ASSETS_DIR at the directory of assets, never at a tarball file.","Add a shell precheck: `[ -d \"$CODEWHALE_SMOKE_ASSETS_DIR\" ] || exit 1`.","Keep the variable unset unless you intentionally supply preassembled assets."],"tags":["configuration","release","smoke-test"],"backgroundTag":"path-is-not-a-directory","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}