Hi all, Is there a way to grab the command line a...
# help
f
Hi all, Is there a way to grab the command line arguments? For example if I run
npm run deploy -- --stage=Integration
, how can I grab the stage? I tried with
process.argv
but that didn't work
t
Grab it where?
In the cdk code the stage is available as
app.stage
You mean you want the raw args?
f
@thdxr, thanks, I wanted to grab some additional arguments and access them while creating the CDK stack. For example;
npm run deploy -- --myTableName="Name"
t
I see, the way to do this would be with environment variables
Copy code
TABLE_NAME=name npm run deploy
f
Ah thanks @thdxr, I used that approach, and was refactoring to simply pass in raw arguments during CDK stack definition. Guess I can work with that for now