Skip to content

Commit

Permalink
fix: replace release tag with releaseBranchName
Browse files Browse the repository at this point in the history
  • Loading branch information
DaRaFF committed Aug 31, 2019
1 parent e16f140 commit cc04f56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/shell/sh-npm-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ module.exports = function (dep) {
const { exec, logBgYellow, logYellow } = dep
return function (argv) {
logBgYellow('Publish dist-tag to npm')
const releaseTag = exec(`echo release-$(echo ${argv.baseTag} | cut -d '.' -f1 -f2).x`)
// const releaseTag = exec(`echo release-$(echo ${argv.baseTag} | cut -d '.' -f1 -f2).x`)
const npmPackageName = exec(`echo $(node -e 'console.log(require("./package.json").name)')`).stdout
const isNpmPublishSet = exec(`echo $(cat package.json | jq '.release.npmPublish')`).stdout
if (isNpmPublishSet !== 'false') {
logYellow(`Add tag ${releaseTag} to npm package version ${npmPackageName}@${argv.baseTag}`)
exec(`npm dist-tag add ${npmPackageName}@${argv.baseTag} ${releaseTag} --//registry.npmjs.org/:_authToken=${argv.npmToken}`, argv.dryRun)
logYellow(`Add tag ${argv.releaseBranchName} to npm package version ${npmPackageName}@${argv.baseTag}`)
exec(`npm dist-tag add ${npmPackageName}@${argv.baseTag} ${argv.releaseBranchName} --//registry.npmjs.org/:_authToken=${argv.npmToken}`, argv.dryRun)
logYellow('dist-tag to npm published')
return
}
Expand Down
4 changes: 2 additions & 2 deletions lib/shell/sh-update-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module.exports = function (dep) {
const { exec, logBgYellow, logYellow } = dep
return function (argv) {
logBgYellow('Update package.json with semantic-release information')
const releaseTag = exec(`echo release-$(echo ${argv.baseTag} | cut -d '.' -f1 -f2).x`)
// const releaseTag = exec(`echo release-$(echo ${argv.baseTag} | cut -d '.' -f1 -f2).x`)
exec(`cat package.json \
| jq ".release.branch=\\"${argv.releaseBranchName}\\" \
| .publishConfig.tag=\\"${releaseTag}\\"" \
| .publishConfig.tag=\\"${argv.releaseBranchName}\\"" \
| cat > package.json.tmp && mv package.json.tmp package.json`
)
logYellow('package.json updated')
Expand Down

0 comments on commit cc04f56

Please sign in to comment.