Skip to content

Commit

Permalink
fix: branch name sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
msanguineti committed Jul 15, 2019
1 parent 0abf48b commit cd9fbca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/cmds/feature/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ export class StartFeature implements CommandModule {
public handler = (argv: Arguments) => {
const branchOff = argv.usedev ? argv.development : argv.main

if (isValidBranchName(argv.featureBranch)) {
if (
isValidBranchName(argv.featureBranch) &&
(branchOff ? isValidBranchName(branchOff) : true)
) {
exec(`git checkout -b ${argv.feature}/${argv.featureBranch} ${branchOff}`)
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/cmds/hotfix/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { exec } from 'shelljs'
/* eslint-enable @typescript-eslint/no-unused-vars */
import { Arguments, CommandModule } from 'yargs'

// const git = simplegit()

export class StartHotfix implements CommandModule {
public command: string = 'start <hotfixName> <from>'

Expand Down

0 comments on commit cd9fbca

Please sign in to comment.