Skip to content

Commit 25b4e74

Browse files
author
Josh Holtz
committed
Some aweesome stuff
1 parent 925a430 commit 25b4e74

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

bin/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ if (process.argv.length > 2) {
66
var configFilePath = './ionic-configurator/config.tmpl.xml';
77
var environmentFilePath = './ionic-configurator/env.' + process.argv[2] + '.json';
88
var outputFilePath = './config.xml';
9+
var outputEnvFilePath = './ionic-configurator-env.json';
910

1011
if (process.argv.length > 4) {
1112
configFilePath = process.argv[2];
1213
environmentFilePath = process.argv[3];
1314
outputFilePath = process.argv[4];
15+
outputEnvFilePath = process.argv[5];
1416
}
1517

16-
Configurator.configure(configFilePath, environmentFilePath, outputFilePath);
18+
Configurator.configure(configFilePath, environmentFilePath, outputFilePath, outputEnvFilePath);
1719
} else {
1820
console.log("Invalid arguments")
1921
}

src/configurator.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
configure: function(configFilePath, environmentFilePath, outputFilePath) {
2+
configure: function(configFilePath, environmentFilePath, outputFilePath, outputEnvFilePath) {
33
var Mustache = require('mustache');
44
var fs = require('fs');
55

@@ -15,7 +15,14 @@ module.exports = {
1515
if (err) {
1616
return console.log(err);
1717
}
18-
console.log("The file was saved!");
18+
console.log("The config file was saved!");
19+
});
20+
21+
fs.writeFile(outputEnvFilePath, JSON.stringify(environmentJSON), function(err) {
22+
if (err) {
23+
return console.log(err);
24+
}
25+
console.log("The env file was saved!");
1926
});
2027
},
2128
hook: function(hook, configPath, configTmplPath) {

0 commit comments

Comments
 (0)