-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
src: Update default Pulsar install paths #49
Conversation
a3b452e
to
65f5995
Compare
Changes: Updates the default install paths for each OS, based on where our new bundled packages (made by electron-builder) install to. Relatedly, adjust logic which finds the app on macOS, for the rebrand. --- Notes: - A relative path from ppm's install dir in the bundled package is tried first, and then the default absolute install path of the whole app is hard-coded as a fallback. The relative path should work for any fully bundled/packaged copy of Pulsar. - This hard-coded fallback shouldn't be needed in actual installs of Pulsar -- this commit is mostly useful for situations where ppm is not bundled with the editor, such as when developing or testing ppm in the context of its own git repo. - On macOS, ppm also uses a search-on-disk "mdfind" command to find other potential install paths, before the hard-coded one, for whatever historical reason. --- Context: This install path is used primarily to locate and read the editor's package.json, which gives various useful metadata for ppm to use, but also to find whatever files are needed from the editor bundle. For example: this metadata is notably used to determine what Electron version to build native C/C++ code for, in whatever packages ppm is used to build. (ppm reads the "electronVersion" field from Pulsar's package.json, which is located in Pulsar's "app.asar" bundle.) (See: src/command.coffee) Pulsar's package.json is also read to get Pulsar's version number. (See: src/command.coffee, src/apm-cli.coffee) It is also read to get the list of bundled packages in the editor. (See: src/install.coffee, src/list.coffee) The install path is also used to find/load the src/compile-cache.js module from among the editor's own source files. (See: src/install.coffee) Likewise, it is used to find/load the src/module-cache.js module from among the editor's own source files. (See: src/rebuild-module-cache.coffee)
65f5995
to
ca316fb
Compare
I verified that the default install paths for Linux, macOS and Windows were as I adjusted them in this commit, as of December 22. If it's changed since then, this PR is out of date. Might be after the recent macOS and Windows build metadata improvement PRs over at Pulsar? EDIT: I think I need to check Note: I updated the macOS identifier from |
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've gone ahead and tried to help out adding the fallback machine install directory of where the asar archive may exist.
Now fair warning I'm unfamiliar with this code so I'd recommend double checking it with you being a bit more familiar as the author of the PR.
But you are right that this also needs to be a fallback on Windows systems after the recent binary build changes.
This is the default path used when the user installs system-wide, rather than installing per-user. Co-authored-by: confused_techie <[email protected]>
Use the new capitalization of the per-user install path, even though Windows is generally case-insensitive for filenames/paths, and in theory/in testing it doesn't matter. I'm just playing it safe.
Thanks for that fix, I tested it and it's working exactly as you wrote it, so I went ahead and committed it. (Also, I went ahead and capitalized the (And thanks again for adding the system-wide install path! Was easier to just test what you wrote than to have to reverse-engineer it myself and be less confident when testing it.) After that super long sidebar... This is ready for review again! |
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.
Approving this one, great work here @DeeDeeG would be happy to get this merged
Thanks for the review, I confirmed the Windows installer shows these same paths, and I 'm not expecting the other OSes to have changed... Merging. 🎉 EDIT: Just noting the tests pass for me on Linux, when rebased on master. |
Changes:
Updates the default install paths for each OS, based on where our new bundled packages (made by electron-builder) install to.
Relatedly, adjust logic which finds the app on macOS, for the rebrand.
Notes:
Context:
This install path is used primarily to locate and read the editor's package.json, which gives various useful metadata for ppm to use, but also to find whatever files are needed from the editor bundle.
For example: this metadata is notably used to determine what Electron version to build native C/C++ code for, in whatever packages ppm is used to build.
(ppm reads the "electronVersion" field from Pulsar's package.json, which is located in Pulsar's "app.asar" bundle.)
(See: src/command.coffee)
Pulsar's package.json is also read to get Pulsar's version number. (See: src/command.coffee, src/apm-cli.coffee)
It is also read to get the list of bundled packages in the editor. (See: src/install.coffee, src/list.coffee)
The install path is also used to find/load the src/compile-cache.js module from among the editor's own source files.
(See: src/install.coffee)
Likewise, it is used to find/load the src/module-cache.js module from among the editor's own source files.
(See: src/rebuild-module-cache.coffee)