forked from proximax-storage/xpx-chain-mobile-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.testnet.js
executable file
·36 lines (31 loc) · 905 Bytes
/
build.testnet.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var fs = require('fs'),
nem = 'src/providers/nem/nem.ts',
config = 'config.xml';
function changeFileContent(file, text, textReplacement, successMessage) {
fs.readFile(file, 'utf-8', function(err, data) {
if (err) throw err;
var newValue = data.replace(text, textReplacement);
if (file === config) {
newValue = newValue.replace(
'co.hexdev.nemwallet.v2.mainnet',
'co.hexdev.nemwallet.v2.testnet'
);
}
fs.writeFile(file, newValue, 'utf-8', function(err) {
if (err) throw err;
console.log(successMessage);
});
});
}
changeFileContent(
nem,
'NEMLibrary.bootstrap(NetworkTypes.MAIN_NET)',
'NEMLibrary.bootstrap(NetworkTypes.TEST_NET)',
'✓ Finished - Changing network to testnet'
);
changeFileContent(
config,
'ProximaX Wallet MN',
'ProximaX Wallet TN',
'✓ Finished - Changing app name to "ProximaX Wallet TN"'
);