From 4e5d5303accf4d6d1b37fa1dafac71bbb9126764 Mon Sep 17 00:00:00 2001 From: Martin Stovicek Date: Mon, 5 Sep 2016 03:13:36 +0200 Subject: [PATCH] Workaround for the "--no-" option bug in commander: - https://github.com/tj/commander.js/issues/108 --- README.md | 8 ++++---- index.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a18b3f0..c0092f2 100644 --- a/README.md +++ b/README.md @@ -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" }, // ... } diff --git a/index.js b/index.js index 21f407c..c4a2431 100644 --- a/index.js +++ b/index.js @@ -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);