Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Commit

Permalink
feat(setup): Save domain answers to config file
Browse files Browse the repository at this point in the history
issue #16
  • Loading branch information
ianpogi5 committed Oct 26, 2019
1 parent 433fc83 commit b556e14
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 14 additions & 1 deletion packages/kdc-cms-setup/lib/create-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,25 @@ const createFile = async ctx => {
const { stage, aws, jwt_secret } = ctx;

if (aws) {
const { region, profile } = aws;
const {
region,
profile,
domain,
apiUrl,
apiUrlCF,
adminUrl,
adminUrlCF
} = aws;
const filename = path.resolve(rootDir, `config.${stage}.yml`);

try {
fs.appendFileSync(filename, `REGION: ${region}\n`, "utf8");
fs.appendFileSync(filename, `PROFILE: ${profile}\n`, "utf8");
fs.appendFileSync(filename, `ROOT_DOMAIN: ${domain}\n`, "utf8");
fs.appendFileSync(filename, `API_URL: ${apiUrl}\n`, "utf8");
fs.appendFileSync(filename, `API_USE_CF: ${apiUrlCF}\n`, "utf8");
fs.appendFileSync(filename, `ADMIN_URL: ${adminUrl}\n`, "utf8");
fs.appendFileSync(filename, `ADMIN_USE_CF: ${adminUrlCF}\n`, "utf8");
} catch (err) {
/* Handle the error */
return Promise.reject(err);
Expand Down
2 changes: 0 additions & 2 deletions packages/kdc-cms-setup/lib/questions-aws.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ const start = async ctx => {
}
]);

console.log(ans);

return {
...ctx,
aws: { ...ans }
Expand Down

0 comments on commit b556e14

Please sign in to comment.