Skip to content

Commit

Permalink
🐛 Fix working with repos with hyphens
Browse files Browse the repository at this point in the history
  • Loading branch information
priestine committed Sep 9, 2020
1 parent 1d8dffd commit 0cc0fff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pure/validators/exit-if-invalid-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ type Ctx = Pick<IAppCtx, 'repository'>

export const exitIfInvalidRepository = ({ logFatalError }: IDeps) => ({ repository }: Ctx) =>
Either.fromNullable(repository)
.chain((repo) => Either.fromNullable(/^\w+\/\w+$/.exec(repo)))
.chain((repo) => Either.fromNullable(/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9.-]+$/.exec(repo)))
.leftMap(() => new Error('Repository undefined or syntax is invalid'))
.leftMap(logFatalError('Could not start the application:'))

0 comments on commit 0cc0fff

Please sign in to comment.