()
| 59 | } |
| 60 | |
| 61 | function ensureGitignore() { |
| 62 | const root = getProjectRootPath(); |
| 63 | const gitignorePath = path.join(root, '.gitignore'); |
| 64 | let contents = ''; |
| 65 | if (fs.existsSync(gitignorePath)) { |
| 66 | contents = fs.readFileSync(gitignorePath, 'utf8'); |
| 67 | } |
| 68 | if (!contents.split(/\r?\n/).includes('.ns-vite-build')) { |
| 69 | if (contents.length && !contents.endsWith('\n')) { |
| 70 | contents += '\n'; |
| 71 | } |
| 72 | contents += '.ns-vite-build\n'; |
| 73 | fs.writeFileSync(gitignorePath, contents, 'utf8'); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | function resolveFlavor(): string { |
| 78 | const flavor = determineProjectFlavor(); |
no test coverage detected