Skip to content

Commit f3bc3ab

Browse files
authored
Merge pull request #76 from rosahaj/fix-rpm-scriptlet
Fix POSTUN scriptlet on RPM upgrade and uninstall
2 parents 04ad263 + 946ae32 commit f3bc3ab

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@
114114
]
115115
},
116116
"rpm": {
117-
"artifactName": "HttpToolkit-${version}.rpm"
117+
"artifactName": "HttpToolkit-${version}.rpm",
118+
"afterRemove": "scripts/post-uninstall-rpm.sh"
118119
},
119120
"appImage": {
120121
"artifactName": "HttpToolkit-${version}.AppImage"

scripts/post-uninstall-rpm.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# This check works only for RPMs
4+
if [ $1 -ge 1 ]; then
5+
# Package upgrade, do not uninstall
6+
exit 0
7+
fi
8+
9+
# Delete the link to the binary
10+
if type update-alternatives >/dev/null 2>&1; then
11+
update-alternatives --remove "httptoolkit" "/opt/HTTP Toolkit/httptoolkit"
12+
else
13+
rm -f "/usr/bin/httptoolkit"
14+
fi

0 commit comments

Comments
 (0)