Skip to content

Commit

Permalink
dest file bugfix, doc
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinegoutagny committed Mar 10, 2016
1 parent 2694706 commit 676e873
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,37 @@ grunt.initConfig({
});
```

Example:

*base.yaml*:
```js
db: 'dev db connection'
misc:
foo: true
bar: 'value'
```

and *target.yaml*:
```js
db: 'prod db connection'
misc:
foo: false
baz: 32
```

are merged into *combined.yaml*:
```js
db: 'prod db connection' // from target
misc:
foo: false // from target
bar: 'value' // from base
baz: 32 // from target
```

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

## Release History

* 2016-03-10: [v1.0.0](https://github.com/Swaven/grunt-merge-yaml/releases/tag/v1.0.0): object keys defined in 2nd file only are added
* 2016-03-10: [v1.0.1](https://github.com/Swaven/grunt-merge-yaml/releases/tag/v1.0.1): object keys defined in 2nd file only are added
* 2016-03-08: [v0.1.0](https://github.com/Swaven/grunt-merge-yaml/releases/tag/v0.1.0): first release
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-merge-yaml",
"description": "Merge together 2 yaml files",
"version": "1.0.0",
"version": "1.0.1",
"homepage": "https://github.com/Swaven/grunt-merge-yaml",
"author": {
"name": "Swaven"
Expand Down
4 changes: 2 additions & 2 deletions tasks/merge_yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module.exports = function(grunt) {
mergedConfig = explore(baseConfig, config),
mergedContent = yaml.safeDump(mergedConfig); // Serialize object as YAML

grunt.file.write('config/config.compiled.yml', mergedContent, {encoding: 'utf-8'});
grunt.log.ok('created config/config.compiled.yml');
grunt.file.write(dest, mergedContent, {encoding: 'utf-8'});
grunt.log.ok('created ' + dest);
});
};

0 comments on commit 676e873

Please sign in to comment.