mirror of
https://github.com/desktop/desktop
synced 2024-08-24 18:57:33 +00:00
add install hooks to deb package
Co-Authored-By: bb441db <jelle.keeris@gmail.com>
This commit is contained in:
parent
8cc232f42d
commit
d4713a175b
|
@ -11,6 +11,8 @@ linux:
|
|||
- AppImage
|
||||
maintainer: 'GitHub, Inc <opensource+desktop@github.com>'
|
||||
deb:
|
||||
afterInstall: './script/linux-after-install.sh'
|
||||
afterRemove: './script/linux-after-remove.sh'
|
||||
depends:
|
||||
# default Electron dependencies
|
||||
- gconf2
|
||||
|
|
25
script/linux-after-install.sh
Normal file
25
script/linux-after-install.sh
Normal file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
PROFILE_D_FILE="/etc/profile.d/${productFilename}.sh"
|
||||
INSTALL_DIR="/opt/${productFilename}"
|
||||
SCRIPT="#!/bin/sh
|
||||
export PATH=$INSTALL_DIR:\$PATH"
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
echo "$SCRIPT" > ${PROFILE_D_FILE};
|
||||
. ${PROFILE_D_FILE};
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
19
script/linux-after-remove.sh
Normal file
19
script/linux-after-remove.sh
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
PROFILE_D_FILE="/etc/profile.d/${productFilename}.sh"
|
||||
|
||||
case "$1" in
|
||||
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
echo "#!/bin/sh" > ${PROFILE_D_FILE};
|
||||
. ${PROFILE_D_FILE};
|
||||
rm ${PROFILE_D_FILE};
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postrm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
Loading…
Reference in a new issue