Skip to content

Commit

Permalink
fix: default region not getting set correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Doiron committed Apr 19, 2023
1 parent fd96a52 commit 35e8371
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/builtins/deploy-delegates/cfn-deployer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ module.exports = {
* @param {Object} options
* @param {Function} callback
*/
function bootstrap(options, callback) {
async function bootstrap(options, callback) {
const {profile, workspacePath} = options;
const userConfig = options.userConfig || {};
const templateLocation = path.join(workspacePath, SKILL_STACK_PUBLIC_FILE_NAME);
let updatedUserConfig;
try {
const templateContent = fs.readFileSync(path.join(__dirname, "assets", SKILL_STACK_ASSET_FILE_NAME), "utf-8");
const awsProfile = awsUtil.getAWSProfile(profile);
const awsDefaultRegion = awsUtil.getCLICompatibleDefaultRegion(awsProfile);
const awsDefaultRegion = await awsUtil.getCLICompatibleDefaultRegion(awsProfile);
fs.writeFileSync(templateLocation, templateContent);
userConfig.templatePath = `./${path.posix.join("infrastructure", path.basename(workspacePath), SKILL_STACK_PUBLIC_FILE_NAME)}`;
updatedUserConfig = R.set(R.lensPath(["awsRegion"]), awsDefaultRegion, userConfig);
Expand Down
4 changes: 2 additions & 2 deletions lib/builtins/deploy-delegates/lambda-deployer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ module.exports = {
* @param {Object} options
* @param {Function} callback
*/
function bootstrap(options, callback) {
async function bootstrap(options, callback) {
const {profile, userConfig} = options;
const awsProfile = awsUtil.getAWSProfile(profile);
const awsDefaultRegion = awsUtil.getCLICompatibleDefaultRegion(awsProfile);
const awsDefaultRegion = await awsUtil.getCLICompatibleDefaultRegion(awsProfile);
const updatedUserConfig = R.set(R.lensPath(["awsRegion"]), awsDefaultRegion, userConfig);
callback(null, {userConfig: updatedUserConfig});
}
Expand Down

0 comments on commit 35e8371

Please sign in to comment.