Skip to content

Commit 233952a

Browse files
committed
Improve printing env var and live AWS resource configuration
1 parent db97b17 commit 233952a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/sandbox/env/_user-env.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ let { join, basename, sep } = require('path')
22
let { existsSync } = require('fs')
33

44
/**
5-
* Initialize Lambdas with local environment variable settings
6-
* - e.g. if ARC_ENV=staging the Lambda env is populated by `@staging`, etc.
5+
* Validate / print status of userland env vars
6+
* e.g. if ARC_ENV=staging the Lambda env is populated by `@staging`, etc.
77
*/
88
module.exports = function validateUserEnv (params, callback) {
99
let { cwd, env: envOption, inventory, restart, update } = params
@@ -34,7 +34,7 @@ module.exports = function validateUserEnv (params, callback) {
3434
// If useAWS is specified, force an AWS environment name
3535
if (prefs?.sandbox?.useAWS &&
3636
![ 'staging', 'production' ].includes(process.env.ARC_ENV)) {
37-
process.env.ARC_ENV = 'staging'
37+
process.env.ARC_ENV = environment = 'staging'
3838
}
3939
}
4040

@@ -74,8 +74,10 @@ module.exports = function validateUserEnv (params, callback) {
7474
}
7575
if (!foundEnv) varsNotFound(environment)
7676

77-
// Wrap it up
78-
if (proj?.preferences?.sandbox?.useAWS || process.env.ARC_LOCAL) {
77+
// Summarize live AWS resources
78+
let useAWS = [ 'staging', 'production' ].includes(process.env.ARC_ENV) &&
79+
process.env.ARC_LOCAL
80+
if (proj?.preferences?.sandbox?.useAWS || useAWS) {
7981
let live = [
8082
inv.tables ? '@tables' : '',
8183
inv['tables-indexes'] ? '@tables-indexes' : '',

0 commit comments

Comments
 (0)