Skip to content

Commit

Permalink
fix: only use concurrently when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 1, 2018
1 parent a8a4b33 commit bd567e1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/generators/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,19 @@ class App extends Generator {
this.pjson.repository = this.answers.github ? `${this.answers.github.user}/${this.answers.github.repo}` : defaults.repository
this.pjson.scripts.posttest = 'yarn run lint'
// this.pjson.scripts.precommit = 'yarn run lint'
this.pjson.scripts.lint = 'concurrently "eslint ."'
if (this.ts && this.mocha) {
this.pjson.scripts.lint = 'concurrently "eslint ." "tsc -p test --noEmit" "tslint -p test"'
} else if (this.ts) {
this.pjson.scripts.lint = 'concurrently "eslint ." "tsc -p . --noEmit" "tslint -p ."'
} else {
this.pjson.scripts.lint = 'eslint .'
}
if (this.mocha) {
this.pjson.scripts.test = `mocha --forbid-only "test/**/*.test.${this._ext}"`
} else {
this.pjson.scripts.test = 'echo NO TESTS'
}
if (this.ts) {
if (this.mocha) {
this.pjson.scripts.lint += ' "tsc -p test --noEmit" "tslint -p test"'
} else {
this.pjson.scripts.lint += ' "tsc -p . --noEmit" "tslint -p ."'
}
this.pjson.scripts.build = 'rm -rf lib && tsc'
this.pjson.scripts.prepublishOnly = 'yarn run build'
}
Expand Down Expand Up @@ -326,7 +327,6 @@ class App extends Generator {
install() {
const dependencies: string[] = []
const devDependencies = [
'concurrently',
'eslint',
'eslint-config-anycli',
]
Expand Down Expand Up @@ -389,6 +389,7 @@ class App extends Generator {
'typescript',
'ts-node',
'@anycli/tslint',
'concurrently',
)
}
Promise.all([
Expand Down

0 comments on commit bd567e1

Please sign in to comment.