From 590daee39b702970b9423b617ce1f6eccbaec1af Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Mon, 13 Jan 2025 23:02:30 -0800 Subject: [PATCH] =?UTF-8?q?Attempt=20to=20genericize=20the=20`.deb`?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …so that PulsarNext can be installed alongside Pulsar. --- script/electron-builder.config.js | 3 ++- script/post-install.sh | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/script/electron-builder.config.js b/script/electron-builder.config.js index 73045b4057..54ca09512b 100644 --- a/script/electron-builder.config.js +++ b/script/electron-builder.config.js @@ -229,7 +229,8 @@ let options = { compression: 'normal', deb: { afterInstall: 'script/post-install.sh', - afterRemove: 'script/post-uninstall.sh' + afterRemove: 'script/post-uninstall.sh', + packageName: baseName }, rpm: { afterInstall: 'script/post-install.sh', diff --git a/script/post-install.sh b/script/post-install.sh index ffe2c53320..727bec57db 100644 --- a/script/post-install.sh +++ b/script/post-install.sh @@ -1,7 +1,7 @@ #!/bin/sh -FILESOURCE='/opt/Pulsar/resources/pulsar.sh' -FILEDEST='/usr/bin/pulsar' +FILESOURCE='/opt/${executable}/resources/${executable}.sh' +FILEDEST='/usr/bin/${executable}' if [ -f "$FILEDEST" ] then @@ -9,8 +9,17 @@ then fi cp "$FILESOURCE" "$FILEDEST" -SYMLINK_TARGET='/opt/Pulsar/resources/app/ppm/bin/apm' -SYMLINK_PATH='/usr/bin/ppm' +case $executable in + pulsar-next) + ppm_executable=ppm-next + ;; + *) + ppm_executable=ppm + ;; +esac + +SYMLINK_TARGET='/opt/${executable}/resources/app/ppm/bin/${ppm_executable}' +SYMLINK_PATH='/usr/bin/${ppm_executable}' if [ -L "$SYMLINK_PATH" ] then