Skip to content

Commit 67e66c4

Browse files
committed
[Issue #12] - html-to-app -c should kill program...
1 parent 9ebd24b commit 67e66c4

2 files changed

Lines changed: 34 additions & 26 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
### Fixes
66

7+
- [Issue #12] - html-to-app -c should kill program after creating config file
8+
79
## [0.1.0] - 2018-03-26
810

911
### Additions

lib/index.js

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -72,36 +72,42 @@ try {
7272
}
7373
catch (ex) {
7474

75-
// Create a config file if asked to do so
76-
if (cli.args.createConfig) {
75+
console.log("No configuration, using defaults.");
76+
77+
}
7778

78-
// Check for config dir
79-
if (!fs.existsSync("config")) {
80-
// Create dir
81-
executeCommand("mkdir config");
82-
}
83-
84-
// Check for environment config file
85-
if (!fs.existsSync("config/" + env + ".json")) {
86-
87-
// Create file
88-
fs.writeFileSync("config/" + env + ".json",
89-
JSON.stringify(
90-
{
91-
"importer": importer,
92-
"converter": converter,
93-
"builder": builder,
94-
"exporter": exporter
95-
},
96-
null,
97-
'\t'
98-
)
99-
);
100-
101-
}
79+
// Create a config file if asked to do so
80+
if (cli.args.createConfig) {
10281

82+
// Check for config dir
83+
if (!fs.existsSync("config")) {
84+
// Create dir
85+
executeCommand("mkdir config");
10386
}
10487

88+
// Check for environment config file
89+
if (!fs.existsSync("config/" + env + ".json")) {
90+
91+
// Create file
92+
fs.writeFileSync("config/" + env + ".json",
93+
JSON.stringify(
94+
{
95+
"importer": importer,
96+
"converter": converter,
97+
"builder": builder,
98+
"exporter": exporter
99+
},
100+
null,
101+
'\t'
102+
)
103+
);
104+
105+
}
106+
107+
// Kill the program
108+
console.log("Configuration file created successfully.");
109+
process.exit();
110+
105111
}
106112

107113
// Append properties to payload

0 commit comments

Comments
 (0)