Skip to content

Commit

Permalink
Workaround for the "--no-" option bug in commander:
Browse files Browse the repository at this point in the history
  • Loading branch information
stovmascript committed Sep 5, 2016
1 parent 9985f11 commit 4e5d530
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -51,19 +51,19 @@ react-native-version

```
-h, --help output usage information
-a, --amend Amend the previous commit. This is done automatically when react-native-version is run from the "postversion" npm script. Use "--no-amend" if you never want to amend.
-A, --no-amend Never amend the previous commit
-a, --amend Amend the previous commit. This is done automatically when react-native-version is run from the "postversion" npm script. Use "--never-amend" if you never want to amend.
-A, --never-amend Never amend the previous commit
-d, --android [path] Path to your "app/build.gradle" file
-i, --ios [path] Path to your "Info.plist" file
```

You can apply these options to the "postversion" script too. If for example you want to commit the changes made by RNV yourself, add the "--no-amend" option:
You can apply these options to the "postversion" script too. If for example you want to commit the changes made by RNV yourself, add the "--never-amend" option:

```js
{
// ...
"scripts": {
"postversion": "react-native-version --no-amend"
"postversion": "react-native-version --never-amend"
},
// ...
}
Expand Down
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -16,8 +16,8 @@ const androidFilePath = path.join(cwd, 'android/app/build.gradle');
const iosFilePath = path.join(cwd, 'ios', appPkg.name, 'Info.plist');

program
.option('-a, --amend', 'Amend the previous commit. This is done automatically when ' + pkg.name + ' is run from the "postversion" npm script. Use "--no-amend" if you never want to amend.') // eslint-disable-line max-len
.option('-A, --no-amend', 'Never amend the previous commit')
.option('-a, --amend', 'Amend the previous commit. This is done automatically when ' + pkg.name + ' is run from the "postversion" npm script. Use "--never-amend" if you never want to amend.') // eslint-disable-line max-len
.option('-A, --never-amend', 'Never amend the previous commit')
.option('-d, --android [path]', 'Path to your "app/build.gradle" file', androidFilePath)
.option('-i, --ios [path]', 'Path to your "Info.plist" file', iosFilePath)
.parse(process.argv);
Expand Down

0 comments on commit 4e5d530

Please sign in to comment.