Skip to content

Commit

Permalink
Improved bumping message
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Aug 6, 2017
1 parent d1a2c1d commit bc2faec
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/bump.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ const semver = require('semver')
// Utilities
const handleSpinner = require('./spinner')

const done = version => {
const { spinner } = global
const text = `Bumped version tag to ${version}`

spinner.succeed(text)
}

module.exports = async type => {
handleSpinner.create('Bumping version in metafiles')
handleSpinner.create('Bumping version tag')

const pkgPath = path.join(process.cwd(), 'package.json')

Expand Down Expand Up @@ -43,7 +50,7 @@ module.exports = async type => {
const lockfilePath = path.join(process.cwd(), 'package-lock.json')

if (!fs.existsSync(lockfilePath)) {
global.spinner.succeed()
done(newVersion)
return
}

Expand All @@ -65,5 +72,5 @@ module.exports = async type => {
handleSpinner.fail(`Couldn't write to "package-lock.json".`)
}

global.spinner.succeed()
done(newVersion)
}

0 comments on commit bc2faec

Please sign in to comment.