Skip to content

functionName results in true name when function name contains -no- #408

Description

@MartinNuc

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 🤞

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions