forked from tonwhales/wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.js
18 lines (14 loc) · 834 Bytes
/
configure.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const fs = require('fs');
const child_process = require('child_process');
// Read version
const version = JSON.parse(fs.readFileSync(__dirname + '/package.json', 'utf-8')).version;
// Bump version code
let versionCode = parseInt(fs.readFileSync(__dirname + '/VERSION_CODE', 'utf-8'), 10);
versionCode++;
fs.writeFileSync(__dirname + '/VERSION_CODE', versionCode.toString());
// Update plist
child_process.execSync(`/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${versionCode}" ${__dirname + '/ios/wallet/Info.plist'}`);
child_process.execSync(`/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${version}" ${__dirname + '/ios/wallet/Info.plist'}`);
// Add updated files to git
child_process.execSync(`git add ${__dirname + '/ios/wallet/Info.plist'}`);
child_process.execSync(`git add ${__dirname + '/VERSION_CODE'}`);