-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add process.path
and process.args
#29
Conversation
Can you confirm this follows the description in #7:
|
This is missing docs and TS definitions. |
Yes, my implementation follows the suggestion:
|
// @stroncium |
@@ -51,6 +51,8 @@ const main = async (options = {}) => { | |||
pid: Number.parseInt(key, 10), | |||
name: path.basename(value.comm), | |||
cmd: value.args, | |||
path: value.comm, | |||
args: value.args.split(value.comm)[1].trim(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer using startsWith
and slice
here. The current way will fail if the args
contain an argument that is the same as comm
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get you. 1) comm
only returns the path name; 2) if they are the same, that means there is no argument and it returns empty string
process.path
and process.args
It doesn't have conflicts with master in terms of code text, but does have them in terms of functionality atm. |
@stroncium Could you elaborate? |
Tests fail after merge. And since the changes are only to the case of multiple |
fix #7