@@ -35,15 +35,18 @@ class ServerlessDeployEnvironment {
35
35
options : {
36
36
command : {
37
37
usage : 'The command to run' ,
38
- shortcut : 'c'
38
+ shortcut : 'c' ,
39
+ type : 'string'
39
40
} ,
40
41
stage : {
41
42
usage : 'The stage to use for stage-specific variables' ,
42
- shortcut : 's'
43
+ shortcut : 's' ,
44
+ type : 'string'
43
45
} ,
44
46
args : {
45
47
usage : 'Extra arguments to pass through to the subprocess' ,
46
- shortcut : 'a'
48
+ shortcut : 'a' ,
49
+ type : 'multiple'
47
50
}
48
51
}
49
52
}
@@ -107,9 +110,9 @@ class ServerlessDeployEnvironment {
107
110
serverless . variables . loadVariableSyntax ( )
108
111
// Explicitly resolve these here, so that we can apply any transformations that we want
109
112
const vars = deasyncPromise ( serverless . variables . populateProperty ( deployVariables , false ) )
110
- serverless . service . deployVariables = _ . merge ( vars . default || { } , vars [ stage ] ) // eslint-disable-line
113
+ serverless . service . deployVariables = _ . merge ( { } , vars . default || { } , vars [ stage ] ) // eslint-disable-line
111
114
const envs = deasyncPromise ( serverless . variables . populateProperty ( deployEnvironment , false ) ) // eslint-disable-line
112
- serverless . service . deployEnvironment = _ . merge ( envs . default || { } , envs [ stage ] ) // eslint-disable-line
115
+ serverless . service . deployEnvironment = _ . merge ( { } , envs . default || { } , envs [ stage ] ) // eslint-disable-line
113
116
}
114
117
115
118
async _resolveDeployEnvironment ( ) {
@@ -125,8 +128,7 @@ class ServerlessDeployEnvironment {
125
128
126
129
async _runWithEnvironment ( ) {
127
130
const deployEnv = await this . _resolveDeployEnvironment ( )
128
- const env = { }
129
- _ . merge ( env , process . env , deployEnv ) // Merge the current environment, overridden with the deploy environment
131
+ const env = _ . merge ( { } , process . env , deployEnv ) // Merge the current environment, overridden with the deploy environment
130
132
const args = this . options . args || ''
131
133
const output = childProcess . execSync ( `${ this . options . command } ${ args } ` , { env, cwd : process . cwd ( ) } ) . toString ( )
132
134
for ( const line of output . split ( '\n' ) ) {
0 commit comments