I wanted to create a function using env var AWS_FUNCTION_NAME=header-no-cache but that results in a function name called true.
I digged in and found that node-lambda uses commander.js like this:
.option('-n, --functionName [' + AWS_FUNCTION_NAME + ']', 'Lambda FunctionName', AWS_FUNCTION_NAME)
That results in flag (the 1st argument for option): -n, --functionName [header-no-cache]
Notice the name of my function in flag configuration. Instead of header-no-cache there should be something like functionName.
The problem is that thanks to -no- string in the flag configuration commander.js thinks that it's a boolean parameter with default value true.
Solution is not to include input from env vars to the flag definition.
... and PR is coming 🤞
I wanted to create a function using env var
AWS_FUNCTION_NAME=header-no-cachebut that results in a function name calledtrue.I digged in and found that
node-lambdauses commander.js like this:That results in flag (the 1st argument for option):
-n, --functionName [header-no-cache]Notice the name of my function in flag configuration. Instead of
header-no-cachethere should be something likefunctionName.The problem is that thanks to
-no-string in the flag configuration commander.js thinks that it's a boolean parameter with default valuetrue.Solution is not to include input from env vars to the flag definition.
... and PR is coming 🤞