* Copy templates/start.sh and templates/start.bat to workDir.
(workDir: string)
| 95 | * Copy templates/start.sh and templates/start.bat to workDir. |
| 96 | */ |
| 97 | function copyStartTemplates(workDir: string): void { |
| 98 | const templateDir = path.resolve( |
| 99 | new URL("../templates", import.meta.url).pathname, |
| 100 | ); |
| 101 | |
| 102 | for (const file of ["start.sh", "start.bat"]) { |
| 103 | const src = path.join(templateDir, file); |
| 104 | const dest = path.join(workDir, file); |
| 105 | if (fs.existsSync(src)) { |
| 106 | fs.copyFileSync(src, dest); |
| 107 | if (file === "start.sh") { |
| 108 | fs.chmodSync(dest, 0o755); |
| 109 | } |
| 110 | } else { |
| 111 | console.warn(chalk.yellow(` [warn] Template not found: ${src}`)); |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | // --------------------------------------------------------------------------- |
| 117 | // create command |
no outgoing calls
no test coverage detected