From cece14d71280d2eeb2da177b88236eb889a0a268 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Wed, 22 Apr 2026 14:08:21 -0700 Subject: [PATCH] chore: add long name alias --- src/electron-build-tools | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 src/electron-build-tools diff --git a/src/electron-build-tools b/src/electron-build-tools new file mode 100755 index 00000000..62468f41 --- /dev/null +++ b/src/electron-build-tools @@ -0,0 +1,27 @@ +#!/usr/bin/env node + +// This file just aliases `e` to the long name `electron-build-tools` as +// well. This alias already exists in `@electron/build-tools`, but some +// users of this repo may add a checkout directly to their PATH and not +// go through `@electron/build-tools`, as that approach does not require +// installing `@electron/build-tools` when switching Node.js versions with +// nvm, for example. This alias is so that `electron/electron` can find us. + +import { existsSync, realpathSync } from 'node:fs'; +import { resolve } from 'node:path'; +import { pathToFileURL } from 'node:url'; + +const ePath = resolve('./e'); + +// Remap this filename to the regular `e` entry point since this is just an alias +process.argv = process.argv.map((arg) => { + if (existsSync(arg)) { + return realpathSync(arg) === realpathSync(import.meta.filename) ? ePath : arg; + } + return arg; +}); + +import('./e').catch((err) => { + console.error(err); + process.exit(1); +});