-
Notifications
You must be signed in to change notification settings - Fork 28.2k
/
index.js
41 lines (38 loc) · 850 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const readJson = require('./read-json.js')
const version = require('./version.js')
const proclog = require('./proc-log.js')
module.exports = async (newversion, opts = {}) => {
const {
path = process.cwd(),
allowSameVersion = false,
tagVersionPrefix = 'v',
commitHooks = true,
gitTagVersion = true,
signGitCommit = false,
signGitTag = false,
force = false,
ignoreScripts = false,
scriptShell = undefined,
preid = null,
log = proclog,
message = 'v%s',
} = opts
const pkg = opts.pkg || await readJson(path + '/package.json')
return version(newversion, {
path,
cwd: path,
allowSameVersion,
tagVersionPrefix,
commitHooks,
gitTagVersion,
signGitCommit,
signGitTag,
force,
ignoreScripts,
scriptShell,
preid,
pkg,
log,
message,
})
}