2021-03-23 14:58:11 -04:00
|
|
|
const readJson = require('./read-json.js')
|
2020-10-02 17:52:19 -04:00
|
|
|
const version = require('./version.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,
|
2021-03-29 15:27:51 -04:00
|
|
|
scriptShell = undefined,
|
2020-10-02 17:52:19 -04:00
|
|
|
preid = null,
|
2022-01-14 19:42:48 +02:00
|
|
|
message = 'v%s',
|
2020-10-02 17:52:19 -04:00
|
|
|
} = opts
|
|
|
|
|
|
|
|
const pkg = opts.pkg || await readJson(path + '/package.json')
|
|
|
|
|
|
|
|
return version(newversion, {
|
|
|
|
path,
|
|
|
|
cwd: path,
|
|
|
|
allowSameVersion,
|
|
|
|
tagVersionPrefix,
|
|
|
|
commitHooks,
|
|
|
|
gitTagVersion,
|
|
|
|
signGitCommit,
|
|
|
|
signGitTag,
|
|
|
|
force,
|
|
|
|
ignoreScripts,
|
2021-03-29 15:27:51 -04:00
|
|
|
scriptShell,
|
2020-10-02 17:52:19 -04:00
|
|
|
preid,
|
|
|
|
pkg,
|
2022-01-14 19:42:48 +02:00
|
|
|
message,
|
2020-10-02 17:52:19 -04:00
|
|
|
})
|
|
|
|
}
|