Skip to content

Commit f973b03

Browse files
committed
Tighten the restrictions on the GitHub path
1 parent 28445af commit f973b03

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ async function init() {
235235
const rawGithubPath = await textPrompt('GitHub path (optional)')
236236
const githubPath = rawGithubPath.replace(/^(https:\/\/github.com\/|\/)/, '')
237237

238-
if (rawGithubPath && !/^[^\/]+\/[^\/]+$/.test(githubPath)) {
238+
// We don't need to be strict here, so long as it won't break the generated files
239+
if (rawGithubPath && !/^[\w-]+\/[\w-.]+$/.test(githubPath)) {
239240
console.log('Invalid GitHub path: ' + rawGithubPath)
240241
process.exit(1)
241242
}

0 commit comments

Comments
 (0)