Skip to content

Commit

Permalink
feat(cmd): add dump version
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Aug 21, 2014
1 parent 195c151 commit 961a85f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Expand Up @@ -39,7 +39,7 @@ $ podspec-bump -w

Incrementing "major", "minor", or "patch" version; or specify version [default: "patch"]

semver!
[Semantic Versioning](http://semver.org/ "Semantic Versioning")!

``` shell
$ podspec-bump major -w
Expand All @@ -55,6 +55,14 @@ You can use `-p` option
$ podspec-bump -p /path/to/example.podspec
```

### Dump version

If you want to know podspec version value, use `--dump-version` option.

```
$ podspec-bump --dump-version
0.1.0
```

## Contributing

Expand Down
10 changes: 9 additions & 1 deletion bin/cmd.js
Expand Up @@ -32,6 +32,12 @@ var optionator = require('optionator')({
type: 'String',
description: 'path to podspec',
example: 'podspec-bump --path /path/to/example.podspec'
},
{
option: 'dump-version',
type: 'Boolean',
description: 'dump podspec version',
example: 'podspec-bump --dump-version'
}
]
});
Expand All @@ -43,7 +49,9 @@ if (options.help) {

function bump(podFilePath) {
var bumper = new PodspecBumper(podFilePath);
if (options.write) {
if (options.dumpVersion) {
console.log(bumper.getVersion());
} else if (options.write) {
fs.writeFileSync(podFilePath, bumper.bumpVersion(version));
} else {
console.log(bumper.bumpVersion(version));
Expand Down

0 comments on commit 961a85f

Please sign in to comment.