-
Notifications
You must be signed in to change notification settings - Fork 10
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
Passing undefined
as cwd
to constructor causes strange behavior
#45
Comments
I suspect it might be related to this: I will try setting the |
A flag could work, but it wouldn't really solve the issue here. The main question is this: is it ever valid to pass |
And if the answer is "yes, it is valid to provide a null/undefinfed path in the constructor", maybe that rules should be changed to require a path even if it's just |
So when we provide null/undefined path in the constructor then it implicitly means the current working directory - https://github.com/kiegroup/act-js/blob/main/src/act/act.ts#L29 However it seems that when you do it from the root of the directory which contains a node_module directory, |
Yes, exactly. Not sure what the proper solution is here w/out forcing a non-null / non-undefined first arg. Probably would be annoying for others. I'm okay with chalking this up to "human error", you can close it if you'd like. |
Yes lets stick with convention that if no path is passed in the constructor then the current working directory will be used. I will update the readme. Although it is annoying that |
Sounds good. |
Describe the bug
new Act(gh.repo.getPath("some invalid repo"))
ends up passingundefined
to theAct
constructor. This, in my case, caused an error where (somehow) a.travis.yml
file was being parsed by Act, with the following output:In this case, the
.travis.yml
file was located in a Node module at path:/path/to/my/project/node_modules/function-bind
To Reproduce
Pass
undefined
to the constructore while you have an invalid*.yml
file somewhere e.g. undernode_modules
.Expected behavior
The constructor probably should require a
cwd
, or throw if one is provided asnull
orundefined
.The text was updated successfully, but these errors were encountered: