Skip to content

feat: allow path override with --ignore-scripts - #25377

Merged
zcbenz merged 1 commit into
electron:masterfrom
skeggse:patch-1
Dec 3, 2020
Merged

zcbenz merged 1 commit into
electron:masterfrom
skeggse:patch-1

Conversation

@skeggse

@skeggse skeggse commented Sep 8, 2020

Copy link
Copy Markdown
Contributor

If you --ignore-scripts when installing electron currently, it'll fail to write the path.txt file and thus fail to use the override dist path. Open to other solutions - just hoping to be able to use a prebuilt electron binary with the default package without having to muck around with it installing an unused version.

Description of Change

Default to electron if the ELECTRON_OVERRIDE_DIST_PATH environment variable is present.

Checklist

Release Notes

Notes: none

@skeggse
skeggse requested a review from a team as a code owner September 8, 2020 16:13
@welcome

welcome Bot commented Sep 8, 2020

Copy link
Copy Markdown

💖 Thanks for opening this pull request! 💖

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@electron-cation electron-cation Bot added new-pr 🌱 PR opened recently and removed new-pr 🌱 PR opened recently labels Sep 8, 2020
Comment thread npm/index.js Resolved
Comment thread npm/index.js Resolved
@skeggse
skeggse requested a review from zcbenz November 2, 2020 05:39
If you --ignore-scripts when installing electron currently, it'll fail
to write the path.txt file and thus fail to use the override dist path.
Open to other solutions - just hoping to be able to use a prebuilt
electron binary with the default package without having to muck around
with it installing an unused version.
@skeggse

skeggse commented Nov 21, 2020

Copy link
Copy Markdown
Contributor Author

:shipit: ?

@zcbenz
zcbenz merged commit 5521f8a into electron:master Dec 3, 2020
@welcome

welcome Bot commented Dec 3, 2020

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

@release-clerk

release-clerk Bot commented Dec 3, 2020

Copy link
Copy Markdown

No Release Notes

@skeggse
skeggse deleted the patch-1 branch December 5, 2020 23:21
rezacr588 added a commit to rezacr588/electron that referenced this pull request Oct 27, 2026
npm/index.js joins ELECTRON_OVERRIDE_DIST_PATH with the executable path
listed in path.txt, and falls back to a bare "electron" when there is no
path.txt (added in electron#25377 for installs that skip scripts). That is only
the right file name on Linux. The executable is
Electron.app/Contents/MacOS/Electron on macOS and electron.exe on
Windows.

Since electron#49328 removed the postinstall script, path.txt does not exist until
the binary is first downloaded, so a fresh install with the override set
always hits that fallback. The override also skips the download, so
require('electron') and the electron command kept pointing at a file that
does not exist.

Fall back to the executable path of the current platform instead, and add
a spec for how npm/index.js resolves the executable path.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
MarshallOfSound pushed a commit that referenced this pull request Nov 10, 2026
npm/index.js joins ELECTRON_OVERRIDE_DIST_PATH with the executable path
listed in path.txt, and falls back to a bare "electron" when there is no
path.txt (added in #25377 for installs that skip scripts). That is only
the right file name on Linux. The executable is
Electron.app/Contents/MacOS/Electron on macOS and electron.exe on
Windows.

Since #49328 removed the postinstall script, path.txt does not exist until
the binary is first downloaded, so a fresh install with the override set
always hits that fallback. The override also skips the download, so
require('electron') and the electron command kept pointing at a file that
does not exist.

Fall back to the executable path of the current platform instead, and add
a spec for how npm/index.js resolves the executable path.

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.

5 participants