Created
December 8, 2018 23:35
-
-
Save xhiroga/3b9546f81e1baa5251f89845ab193810 to your computer and use it in GitHub Desktop.
Upgrade Expo App version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put this file on top directory in your expo project. | |
APP_JSON_FILE = 'app.prod.json' | |
var app_json = require(APP_JSON_FILE) | |
version = app_json.expo.version | |
console.log(`Latest version: ${version}`) | |
match = /([0-9]+\.[0-9]+\.)([0-9]+)/.exec(version) | |
major_minor_version = match[1] | |
patch_version = match[2] | |
new_patch_version = Number(patch_version) + 1 | |
new_version = major_minor_version + new_patch_version | |
console.log(`New version: ${new_version}`) | |
app_json.expo.version = new_version | |
console.log(app_json) | |
const fs = require('fs') | |
fs.writeFileSync(APP_JSON_FILE, JSON.stringify(app_json, null, 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment