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

Commit

Permalink
Serializer YAML file
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Oct 4, 2016
1 parent 5fd115e commit 41304ff
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
3 changes: 1 addition & 2 deletions lib/Bumped.config.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ jsonFuture = require 'json-future'
util = require './Bumped.util'
DEFAULT = require './Bumped.default'
MSG = require './Bumped.messages'
parser = require 'parse-config-file'

module.exports = class Config

Expand Down Expand Up @@ -119,7 +118,7 @@ module.exports = class Config
save: =>
[opts, cb] = DEFAULT.args arguments

util.saveCSON
util.saveConfig
path : ".#{@bumped.pkg.name}rc"
data :
files: @rc.files
Expand Down
25 changes: 21 additions & 4 deletions lib/Bumped.default.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,29 @@ Args = require 'args-js'

module.exports =

scaffold: ->
scaffold: (files) ->
return {
files: []
files: [ 'package.json']
plugins:
prerelease: {}
postrelease: {}

prerelease:
'Linting config files':
plugin: 'bumped-finepack'
postrelease:
'Generating CHANGELOG file':
plugin: 'bumped-changelog'
'Commiting new version':
plugin: 'bumped-terminal'
command: 'git add CHANGELOG.md package.json && git commit -m "Release $newVersion"'
'Detecting problems before publish':
plugin: 'bumped-terminal'
command: 'git-dirty && npm test'
'Publishing tag at Github':
plugin: 'bumped-terminal'
command: 'git tag $newVersion && git push && git push --tags'
'Publishing at NPM':
plugin: 'bumped-terminal'
command: 'npm publish'
}

keywords:
Expand Down
5 changes: 3 additions & 2 deletions lib/Bumped.util.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dotProp = require 'dot-prop'
jsonFuture = require 'json-future'
parser = require 'parse-config-file'
parserAsync = async.asyncify parser
serializer = require('yaml-parser').safeDump

module.exports =

Expand Down Expand Up @@ -51,8 +52,8 @@ module.exports =

async.waterfall tasks, cb

saveCSON: (opts, cb) ->
data = require('season').stringify opts.data, null, 2
saveConfig: (opts, cb) ->
data = serializer opts.data
fs.writeFile opts.path, data, encoding: 'utf8', cb

isBoolean: (n) ->
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"semver": "~5.3.0",
"spawn-sync": "~1.0.15",
"time-span": "~1.0.0",
"update-notifier": "~1.0.0"
"update-notifier": "~1.0.0",
"yaml-parser": "~3.5.3"
},
"devDependencies": {
"coveralls": "latest",
Expand Down

0 comments on commit 41304ff

Please sign in to comment.