Skip to content

Commit

Permalink
Try to be more selective in what we copy to resources/ppm/bin/
Browse files Browse the repository at this point in the history
  • Loading branch information
savetheclocktower committed Nov 1, 2024
1 parent 4c87749 commit 11d930a
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions script/electron-builder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,25 @@ let options = {

extraResources: [
{ from: 'pulsar.sh', to: `${baseName}.sh` },
{ from: 'ppm', to: 'app/ppm' },
{
// Be selective in what we copy over to PPM’s `bin` directory. On
// Windows, the contents of this entire folder will be available on the
// `PATH`, so we shouldn’t put stray stuff in here.
//
// Below we copy over `ppm` itself, but it might have its name changed in
// the process depending on the release channel.
from: [
// Everything below `ppm`…
'ppm/**',
// …except for files inside the `bin` directory.
'!ppm/bin'
],
to: 'app/ppm'
},
// This shell script is used on macOS and Linux; it doesn't hurt to include
// it on Windows, and it might even be consumed in WSL or Cygwin
// environments.
{ from: 'ppm/bin/ppm', to: `app/ppm/bin/${ppmBaseName}` },
{ from: ICONS.png, to: 'pulsar.png' },
{ from: 'LICENSE.md', to: 'LICENSE.md' }
],
Expand Down Expand Up @@ -228,7 +246,7 @@ let options = {
// (used only by desktops to show it on bar/switcher and app menus).
"from": ICONS.svg,
"to": "pulsar.svg"
},
}
]
},

Expand Down Expand Up @@ -272,7 +290,10 @@ let options = {
{ from: ICONS.ico, to: 'pulsar.ico' },
{ from: 'resources/win/pulsar.cmd', to: `${baseName}.cmd` },
{ from: 'resources/win/pulsar.js', to: `${baseName}.js` },
{ from: 'resources/win/modifyWindowsPath.ps1', to: 'modifyWindowsPath.ps1' }
{ from: 'resources/win/modifyWindowsPath.ps1', to: 'modifyWindowsPath.ps1' },
// Copy `ppm.cmd` to the `ppm/bin` directory, possibly renaming it
// `ppm-next.cmd` depending on release channel.
{ from: 'ppm/bin/ppm.cmd', to: `app/ppm/bin/${ppmBaseName}.cmd` },
],
target: [
{ target: 'nsis' },
Expand All @@ -293,6 +314,10 @@ let options = {
// AppID 'dev.pulsar-edit.pulsar'. If this value ever changes, a PR to
// GitHub Desktop must be made with the updated value.
//
// We delete this value when building PulsarNext so that it’s regenerated
// based on the app ID. Otherwise the OS might consider it equivalent to
// stable Pulsar in some ways.
//
// TODO: On first look, this installer script seems not to need any
// updating for PulsarNext, but we should make sure.
include: "resources/win/installer.nsh",
Expand All @@ -314,19 +339,6 @@ if (ARGS.next) {
// TODO: Should PulsarNext have its own guid? `electron-builder` docs suggest
// it will be generated from the `appId` if omitted, so I think this is fine.
delete options.nsis.guid;

// We need to copy `ppm` over to `ppm-next` when `--next` is passed, but not
// copy `ppm` over to `ppm` when `--next` is omitted (because it's
// redundant).
options.linux.extraResources.push(
{ from: 'ppm/bin/ppm', to: `app/ppm/bin/${ppmBaseName}` }
);
options.win.extraResources.push(
{ from: 'ppm/bin/ppm.cmd', to: `app/ppm/bin/${ppmBaseName}.cmd` },
);
options.mac.extraResources.push(
{ from: 'ppm/bin/ppm', to: `app/ppm/bin/${ppmBaseName}` }
);
}

function whatToBuild() {
Expand Down

0 comments on commit 11d930a

Please sign in to comment.