Skip to content

Commit

Permalink
fix: only build on release
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 28, 2018
1 parent 7be5fd1 commit fecec26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/generators/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class App extends Generator {
}
}
if (this.ts) {
this.pjson.scripts.prepare = defaults.scripts.prepare || 'rm -rf lib && tsc'
this.pjson.scripts.prepublishOnly = defaults.scripts.prepublishOnly || 'rm -rf lib && nps build'
}
if (this.semantic_release) {
this.pjson.scripts.commitmsg = defaults.scripts.commitmsg || 'dxcli-commitlint'
Expand Down
5 changes: 5 additions & 0 deletions templates/app/package-scripts.js.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const {
crossEnv,
mkdirp,
series,
<%_ } else if (ts) { _%>
series,
<%_ } _%>
} = require('nps-utils')

Expand All @@ -29,6 +31,9 @@ const linters = {
const scripts = {
...linters,
lint: concurrent(linters),
<%_ if (ts) { _%>
build: series('rm -rf lib', 'tsc'),
<%_ } _%>
<%_ if (mocha) { _%>
test: script(concurrent.nps(...Object.keys(linters), 'mocha'), 'lint and run all tests'),
mocha: script('mocha --forbid-only "test/**/*.test.<%= _ext %>"', 'run all mocha tests'),
Expand Down

0 comments on commit fecec26

Please sign in to comment.