Skip to content
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

Use plain path.join to fix path handling #22

Merged
merged 1 commit into from
Mar 8, 2016

Conversation

develar
Copy link
Contributor

@develar develar commented Mar 3, 2016

Fix error "Path to copy doesn't exist D:\dev\projects\privateName\src\electron\dev\projects\ privateName\src\electron\node_modules\electron-winstaller\vendor\Update.exe"

use plain path.join — path helper doesn't add any value

@develar develar force-pushed the use-path-join branch 3 times, most recently from 2528652 to ca08067 Compare March 3, 2016 15:25
develar added a commit to develar/electron-builder that referenced this pull request Mar 3, 2016
PR is required to fix windows-installer — blocked on electron/windows-installer#22
develar added a commit to develar/electron-builder that referenced this pull request Mar 3, 2016
PR is required to fix windows-installer — blocked on electron/windows-installer#22
await jetpack.copyAsync(
p`${__dirname}/../vendor/Update.exe`,
p`${appDirectory}/Update.exe`);
const vendorPath = path.join(__dirname, "..", "vendor");
Copy link
Contributor

Choose a reason for hiding this comment

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

path.resolve('../vendor') can be used instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. No. See docs — "the current working directory is used as well".

This was referenced Mar 4, 2016
@lukeapage
Copy link
Contributor

This probably fixes #13. You can also use jetpack more for path resolution.

@develar
Copy link
Contributor Author

develar commented Mar 4, 2016

@lukeapage Ci failed due to unrelated error. Could you please restart AppVeyor build? Otherwise I have to push some dummy change to trigger rebuild.

@develar
Copy link
Contributor Author

develar commented Mar 4, 2016

@lukeapage I want to get rid of jetpack because jetpack uses q instead of bluebird. Bluebird ships with the best cross-platform long stack traces. fs-extra + Promise.promisifyAll is enough. No need yet another fs lib (electron-builder and electron-packager uses fs-extra).

@lukeapage
Copy link
Contributor

@develar I'm not a admin on this repo, I just fixed a few things recently and took a look at the PR - so I can't restart appveyor - the same thing is happening on my PR's where I've just changed documentation. You can't see who is an admin on electronjs, the only person I know for sure is admin is @kevinsawicki but he is usually quite fast at looking at PR's

re: jetpack - fine by me

@havenchyk havenchyk mentioned this pull request Mar 4, 2016
@anaisbetts
Copy link
Contributor

I don't think this is related to path.join, I think this is a jetpack issue. I had to replace several methods with fs versions and they would work, it appears that jetpack will insert ./'s into paths which throws them off

@develar
Copy link
Contributor Author

develar commented Mar 4, 2016

@paulcbetts path helper does path.resolve(...parts) and on error path.join(...parts); For what? Why not use just path.join? Yes, I want to get rid of jetpack and use promisified fs-extra. What do you think? I can prepare PR.

@thers
Copy link

thers commented Mar 4, 2016

@paulcbetts replacing path-helper with path.join solves the problem, tested it

@develar
Copy link
Contributor Author

develar commented Mar 4, 2016

@ridersx +1 electron-builder was published (2.8.5) with my changes and user reported that issue is gone.

@develar
Copy link
Contributor Author

develar commented Mar 6, 2016

And yes — don't use windows-installer yet, use only previous version (not es6). A lot of errors — at least electron-userland/electron-builder#208 electron-builder 2.8.6 will continue to use my own fixed version.

@havenchyk
Copy link
Contributor

I can confirm that still have errors during building on windows. Even after ths PR applying.

@havenchyk
Copy link
Contributor

@kevinsawicki could you please take a look?

@develar develar force-pushed the use-path-join branch 2 times, most recently from 6306ea6 to a0e13a9 Compare March 8, 2016 11:20
develar added a commit to develar/windows-installer that referenced this pull request Mar 8, 2016
@develar
Copy link
Contributor Author

develar commented Mar 8, 2016

PR updated — path-helper.js completely removed.

@develar
Copy link
Contributor Author

develar commented Mar 8, 2016

Confirmed by @havenchyk that path-helper.js completely removed fixes the issue electron-userland/electron-builder#208 I hope it will be merged, we cannot yet use original winstaller, but finally I hope all my changes will be accepted.

@kevinsawicki
Copy link
Contributor

Minor style comment, but it looks like both single quotes and double quotes are used in the new path.join calls.

It would be nice to be consistent and maybe just standardize on single quotes.

@develar
Copy link
Contributor Author

develar commented Mar 8, 2016

@kevinsawicki Fixed, eslint rule added to avoid such error in the future.

@kevinsawicki
Copy link
Contributor

eslint rule added to avoid such error in the future.

Awesome, thanks 👍

kevinsawicki added a commit that referenced this pull request Mar 8, 2016
Use plain path.join to fix path handling
@kevinsawicki kevinsawicki merged commit 90c28b5 into electron:master Mar 8, 2016
@develar develar deleted the use-path-join branch March 8, 2016 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants