codekingpro/portable-devtools
114k
1const readJson = require('./read-json.js')
2const version = require('./version.js')
3
4module.exports = async (newversion, opts = {}) => {
5 const {
6 path = process.cwd(),
7 allowSameVersion = false,
8 tagVersionPrefix = 'v',
9 commitHooks = true,
10 gitTagVersion = true,
11 signGitCommit = false,
12 signGitTag = false,
13 force = false,
14 ignoreScripts = false,
15 scriptShell = undefined,
16 preid = null,
17 message = 'v%s',
18 } = opts
19
20 const pkg = opts.pkg || await readJson(path + '/package.json')
21
22 return version(newversion, {
23 path,
24 cwd: path,
25 allowSameVersion,
26 tagVersionPrefix,
27 commitHooks,
28 gitTagVersion,
29 signGitCommit,
30 signGitTag,
31 force,
32 ignoreScripts,
33 scriptShell,
34 preid,
35 pkg,
36 message,
37 })
38}
39 