Skip to content

Commit 93aa662

Browse files
committed
Make the GitHub path easier to use
1 parent 9081153 commit 93aa662

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,16 @@ async function init() {
225225
process.exit(1)
226226
}
227227

228-
const githubPath = await textPrompt('GitHub path, e.g. skirtles-code/test-project (optional)')
228+
console.log()
229+
console.log('The GitHub path you provide below is used to generate various URLs.')
230+
console.log('For example, if you intended to have your repo at https://github.com/vuejs/core then the path would be vuejs/core.')
231+
console.log()
232+
233+
const rawGithubPath = await textPrompt('GitHub path (optional)')
234+
const githubPath = rawGithubPath.replace(/^(https:\/\/github.com\/|\/)/, '')
229235

230-
if (githubPath && !/^[\w-]+\/[\w-]+$/.test(githubPath)) {
231-
console.log('Invalid GitHub path: ' + githubPath)
236+
if (rawGithubPath && !/^[^\/]+\/[^\/]+$/.test(githubPath)) {
237+
console.log('Invalid GitHub path: ' + rawGithubPath)
232238
process.exit(1)
233239
}
234240

0 commit comments

Comments
 (0)