Skip to content

Commit

Permalink
feat: get config from package.json#monorepoHooks
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Nov 19, 2018
1 parent 51d754f commit 3abf2df
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 35 deletions.
60 changes: 31 additions & 29 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@
},
"dependencies": {
"app-root-path": "^2.1.0",
"lodash": "^4.17.11",
"read-pkg": "^4.0.1",
"semver": "^5.6.0"
"lodash": "^4.17.11"
},
"release": {
"branch": "master",
Expand Down
10 changes: 7 additions & 3 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
const reqlib = require('app-root-path').require
const readPkg = require('read-pkg').sync
const log = require('./log')
const releaserc = (() => {
try {
return reqlib('/.releaserc.js')
} catch (e) {

} catch (err) {
log('`.releaserc.js` is not found, so `package.json#release` is used instead')
return readPkg().release
log('err=', err)

const pkg = reqlib('/package.json')

return pkg.release || pkg
}
})()

Expand Down

0 comments on commit 3abf2df

Please sign in to comment.