Skip to content

Commit

Permalink
Add tslint and fix some missing await issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bradymholt committed Dec 5, 2018
1 parent 4e473a4 commit 3db8018
Show file tree
Hide file tree
Showing 5 changed files with 187 additions and 41 deletions.
26 changes: 11 additions & 15 deletions ops/config-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import * as path from "path";
import * as yaml from "js-yaml";
import * as inquirer from "inquirer";

init();

function init() {
(async function() {
const configFile = path.join(__dirname, "config.yml");
const templateFile = path.join(__dirname, "config.yml.example");

Expand Down Expand Up @@ -61,15 +59,13 @@ function init() {
);
}

(async function() {
const answers = await inquirer.prompt(questions);
config.all.vars.deploy_user = answers.deploy_user;
config.all.vars.gh_pubkey_user = answers.gh_pubkey_user;
config.production.hosts = answers.host;
for (let i = 0; i < config.production.vars.cron_jobs.length; i++) {
config.production.vars.cron_jobs[i].cron_hour = answers[`job_${i}_cron_hour`];
config.production.vars.cron_jobs[i].app_args = answers[`job_${i}_app_args`];
}
fs.writeFileSync(configFile, yaml.safeDump(config));
})();
}
const answers = await inquirer.prompt(questions);
config.all.vars.deploy_user = answers.deploy_user;
config.all.vars.gh_pubkey_user = answers.gh_pubkey_user;
config.production.hosts = answers.host;
for (let i = 0; i < config.production.vars.cron_jobs.length; i++) {
config.production.vars.cron_jobs[i].cron_hour = answers[`job_${i}_cron_hour`];
config.production.vars.cron_jobs[i].app_args = answers[`job_${i}_app_args`];
}
fs.writeFileSync(configFile, yaml.safeDump(config));
})();
Loading

0 comments on commit 3db8018

Please sign in to comment.