Skip to content

Commit 80a581a

Browse files
committed
Fix regexp
1 parent 22bc2cc commit 80a581a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

scripts/add-repository.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async function addProject() {
2323
}
2424
}
2525

26-
if (!/^[\w]+\/[\w]+$/.test(repository)) {
26+
if (!/^[\w-]+\/[\w-]+$/.test(repository)) {
2727
throw new Error(`Unsupported repository '${input}'.`);
2828
}
2929

src/repositories.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export function getRepositories(): Repository[] {
3636
const rawRepository = _rawRepository as RawRepository;
3737

3838
assert.equal(typeof rawRepository.repository, "string");
39-
assert.ok(/^\w+\/\w+$/.test(rawRepository.repository));
39+
assert.ok(
40+
/^[\w-]+\/[\w-]+$/.test(rawRepository.repository),
41+
`Invalid repository '${rawRepository.repository}'`,
42+
);
4043
assert.equal(typeof rawRepository.commit, "string");
4144

4245
const glob = Array.isArray(rawRepository.glob)

0 commit comments

Comments
 (0)