Skip to content

Commit 37ea573

Browse files
committed
Handle some name collision edge cases
1 parent 93aa662 commit 37ea573

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,24 @@ async function init() {
245245
const includePlayground = await togglePrompt('Include playground application for development?', true)
246246
const includeExamples = await togglePrompt('Include example code?', true, 'Yes', 'No, just configs')
247247

248+
function suggestExtended() {
249+
if (!extended) {
250+
console.log(`Use the --extended flag to configure the directory name separately.`)
251+
}
252+
}
253+
254+
if (includeDocs && mainPackageDirName === 'docs') {
255+
console.log(`The directory name 'docs' is reserved for the documentation, please choose a different name.`)
256+
suggestExtended()
257+
process.exit(1)
258+
}
259+
260+
if (includePlayground && mainPackageDirName === 'playground') {
261+
console.log(`The directory name 'playground' is reserved for the playground, please choose a different name.`)
262+
suggestExtended()
263+
process.exit(1)
264+
}
265+
248266
const [githubUserName, githubRepoName] = (githubPath || '/').split('/')
249267
const githubUrl = githubPath ? `https://github.com/${githubPath}` : ''
250268
const githubIssues = githubPath ? `${githubUrl}/issues` : ''

0 commit comments

Comments
 (0)