You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be really nice to add support for the opt reference, i.e.: ${opt:stage}
I think the only way to really do this would be to allow users to pass a cliOptions object to readYamlSync. Then you could treat it very similarly to the env reference.
I created PR #9 which should handle this, as I also came across this need. Along the way though, I found out you can work around this by passing in a context object into readYamlSync as follows. Just build up your desired opt values within the switch statement.
return parser.readYamlSync(file,null,{
opt: (x) => {
switch(x[0]) {
case 'stage':
return 'dev';
default:
return x[1]; // expand upon this as necessary for your use case, ex: x[1] || x[2] || x[3]
}
}
});
It would be really nice to add support for the opt reference, i.e.:
${opt:stage}
I think the only way to really do this would be to allow users to pass a
cliOptions
object toreadYamlSync
. Then you could treat it very similarly to the env reference.Ideally, the following would be possible:
If the serverless file uses the opt reference, everything breaks, which is very unfortunate.
The text was updated successfully, but these errors were encountered: