{"record":{"id":"53697c8059b1f8d0","repo":"windmill-labs/windmill","slug":"overwriting-existing-foldername-overwrite","errorCode":null,"errorMessage":"Overwriting existing '${folderName}' (--overwrite)","messagePattern":"Overwriting existing '(.+?)' \\(--overwrite\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/app/new.ts","lineNumber":597,"sourceCode":"\n  // Load nonDottedPaths setting from wmill.yaml before creating folder\n  await loadNonDottedPathsSetting();\n\n  // Create the directory structure - preserve full path (e.g., f/foobar/x/y becomes f/foobar/x/y.raw_app)\n  const folderName = buildFolderPath(appPath, \"raw_app\");\n  const appDir = path.join(process.cwd(), folderName);\n\n  // Check if directory already exists\n  let dirExists = false;\n  try {\n    await stat(appDir);\n    dirExists = true;\n  } catch {\n    // Directory doesn't exist, which is good\n  }\n  if (dirExists) {\n    if (opts.overwrite) {\n      log.warn(colors.yellow(`Overwriting existing '${folderName}' (--overwrite)`));\n    } else if (nonInteractive) {\n      log.error(\n        colors.red(\n          `Directory '${folderName}' already exists. Pass --overwrite to replace it.`\n        )\n      );\n      return;\n    } else {\n      const overwrite = await Confirm.prompt({\n        message: `Directory '${folderName}' already exists. Overwrite?`,\n        default: false,\n      });\n      if (!overwrite) {\n        log.info(colors.yellow(\"Aborted.\"));\n        return;\n      }\n    }\n    // Wipe before re-creating so leftover files from a different framework","sourceCodeStart":579,"sourceCodeEnd":615,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/app/new.ts#L579-L615","documentation":"Heads-up from `wmill app new`: the target raw_app folder already exists and --overwrite was given, so the command will delete and regenerate its contents. Purely informational — anything inside the existing folder not regenerated by the scaffold is lost.","triggerScenarios":"Thrown at cli/src/commands/app/new.ts:597 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Commit or back up the existing folder before using --overwrite","Remove --overwrite to be stopped by the exists-check instead","Point the command at a different path if the old app must be kept"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}