diff --git a/script/electron-builder.js b/script/electron-builder.js index 89aceb679b..8032f8ce3f 100644 --- a/script/electron-builder.js +++ b/script/electron-builder.js @@ -149,7 +149,7 @@ let options = { }, rpm: { afterInstall: "script/post-install.sh", - afterRemove: "script/post-uninstall.sh", + afterRemove: "script/post-uninstall-rpm.sh", compression: 'xz', fpm: ['--rpm-rpmbuild-define=_build_id_links none'] }, diff --git a/script/post-uninstall-rpm.sh b/script/post-uninstall-rpm.sh new file mode 100644 index 0000000000..f68d62c968 --- /dev/null +++ b/script/post-uninstall-rpm.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# https://github.com/pulsar-edit/pulsar/issues/544 +# This check works only for RPMs +if [ $1 -ge 1 ]; then + # Package upgrade, do not uninstall + exit 0 +fi + +PULSAR_SCRIPT_PATH='/usr/bin/pulsar' + +if [ -f "$PULSAR_SCRIPT_PATH" ] +then + rm "$PULSAR_SCRIPT_PATH" +fi + +PPM_SYMLINK_PATH='/usr/bin/ppm' + +if [ -L "$PPM_SYMLINK_PATH" ] +then + rm "$PPM_SYMLINK_PATH" +fi