stovmascript/react-native-version

RNV and pre-commit: android version change doesn't get into commit

terreb opened this issue · 1 comments

I'm using npm pre-commit package to have my build version bumped before every commit (This is the requirement and I really need this like so). For some reason RNV changes build.gradle after commit, so the version change doesn't get into that commit.

Here is my package.json:

{
  "scripts": {
    "bumb_internal_build": "node ./scripts/bumpInternalBuildNumber.js && git add ./src/buildNumber.json",
    "bump_build_android": "node ./node_modules/react-native-version/cli.js --never-amend --increment-build --target android",
  },
  "pre-commit": [
    "bumb_internal_build",
    "bump_build_android"
  ],
  "dependencies": {
    "react": "^16.6.3",
    "react-native": "^0.57.8"
  },
  "devDependencies": {
    "pre-commit": "^1.2.2"
  }
}

Am I overlooking anything?

I think you have to stage the changed files same as you do with git add ./src/buildNumber.json in the first script.