Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Commit

Permalink
UI consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Oct 16, 2015
1 parent 8600578 commit f525656
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 9 additions & 2 deletions lib/Bumped.animation.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ DEFAULT = require './Bumped.default'
MSG = require './Bumped.messages'
chalk = require 'acho/node_modules/chalk'

TYPE_SHORTCUT =
prerelease: 'pre'
postrelease: 'post'

module.exports = class Animation

constructor: (params = {}) ->
Expand All @@ -13,8 +17,12 @@ module.exports = class Animation
start: (cb) ->
@start = new Date()
@running = true
@logger.keyword = @plugin

shortcut = TYPE_SHORTCUT[@type]
name = @plugin.replace /bumped-/, ''
@logger.keyword = "#{shortcut} #{name}"
@logger.success "Starting '#{chalk.cyan(@text)}'..."

cb()

stop: (err, cb) ->
Expand All @@ -34,5 +42,4 @@ module.exports = class Animation
if opts.outputMessage
diff = ms(new Date() - opts.start)
message = "#{MSG.CREATED_VERSION(opts.version)} after #{chalk.magenta(diff)}."
process.stdout.write '\n'
opts.logger.success message
7 changes: 4 additions & 3 deletions lib/Bumped.plugin.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ module.exports = class Plugin
@cache = {}

exec: (opts, cb) ->
type = @[opts.type]
return cb null if @isEmpty type
pluginType = @[opts.type]
return cb null if @isEmpty pluginType

async.forEachOfSeries type, (settings, description, next) =>
async.forEachOfSeries pluginType, (settings, description, next) =>
pluginPath = forceResolve(settings.plugin)[0]
@notifyPlugin pluginPath
plugin = @cache[settings.plugin] ?= require pluginPath
Expand All @@ -38,6 +38,7 @@ module.exports = class Plugin
text: description
logger: @bumped.logger
plugin: settings.plugin
type: opts.type

animation.start =>
plugin @bumped, pluginObjt, (err) ->
Expand Down

0 comments on commit f525656

Please sign in to comment.