Skip to content

fix: use empty string path when function source is not specified #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 13, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const argv = minimist(process.argv, {

const CODE_LOCATION = resolve(
process.cwd(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't process.cwd redundant here? According to the docs [1] the cwd is prepended to any relative path.

https://nodejs.org/docs/latest/api/path.html#path_path_resolve_paths

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is redundant. I thought the docs meant cwd would be used as a path instead of cwd being prepended.

argv[FLAG.SOURCE] || process.env[ENV.SOURCE]
argv[FLAG.SOURCE] || process.env[ENV.SOURCE] || ''
);
const PORT = argv[FLAG.PORT] || process.env[ENV.PORT] || '8080';
const TARGET = argv[FLAG.TARGET] || process.env[ENV.TARGET] || 'function';
Expand Down