-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix dir of getNameAndVersion for require package.json #440
Conversation
Thanks for the fix! Could you add a test for this so we don't have a regression in the future? |
This is also still broken on Windows EDIT: nevermind my bad! Looks like my global electron-packager was being used instead of my local. Works great. :) |
@jhen0409 I assume the test fails without your fix? |
@jhen0409 Hmmm, the test seems to fail with the fix too. (You should run |
@malept Sorry 😂, it should fixed. |
If someone could make sure that the test fails without the fix applied, I would appreciate it. Otherwise I'll test it later today (or tomorrow depending on how much time I have available). |
This is test fail log without my first commit:
|
@jhen0409 thanks! |
@malept Sorry to report again, but getNameAndVersion(opts, path.resolve(process.cwd(), opts.dir) || process.cwd(), function (err) {
...
}) ...assumes that the path.resolve(process.cwd(), opts.dir) || process.cwd() to process.cwd() || path.resolve(process.cwd(), opts.dir) should do the trick and works for my setup as well. |
@SimulatedGREG Could you please file a PR (with a testcase)? I will review as soon as I can. |
@SimulatedGREG Hmmm. Now that I think about it, doesn't that change give the current working directory priority over the specified |
@malept I can make a PR later today, but not comfortable with doing tests so I'll try my best. |
I am also not opposed to putting
@SimulatedGREG The important part about the test is creating a minimal fixture that exemplifies the problem that you're seeing. I can help with the code part. |
From what I can see, I don't believe reversing the OR statement would be problem. Even if the current working directory had priority over I made an adjustment in my fork which simply checks the parent directory if a electron/electron-prebuilt version isn't inferred from |
Reversing the OR statement would be a problem because I would prefer re-adding |
Now I see the problem better. I'll try getting |
Reached out to @substack to see about getting that upstream-upstream |
The other alternative is to fix rahatarmanahmed/get-package-info#2. |
I'd be happy to accept a PR for rahatarmanahmed/get-package-info#2, I think that's the better, more immediately fixable solution than getting substack to merge the |
short term fix: #445 |
Related to #439.
Also, we don't need to check
!pkg
, because it will throwmodule not found
error if no package.json file found.