Skip to content

Commit

Permalink
add CLI support to Debian package, add Elementary OS shell and editor…
Browse files Browse the repository at this point in the history
… support (shiftkey#231)
  • Loading branch information
jfgordon2 authored and ImgBotApp committed Apr 20, 2024
1 parent 957cf78 commit 6efb9d5
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 35 deletions.
35 changes: 0 additions & 35 deletions app/static/linux/github

This file was deleted.

33 changes: 33 additions & 0 deletions script/linux-after-install.sh
@@ -0,0 +1,33 @@
#!/bin/bash

set -e

PROFILE_D_FILE="/etc/profile.d/github-desktop.sh"
INSTALL_DIR="/opt/${productFilename}"
CLI_DIR="$INSTALL_DIR/resources/app/static"

case "$1" in
configure)
# add executable permissions for CLI interface
chmod +x "$CLI_DIR"/github || :
# check if this is a dev install or standard
if [ -f "$INSTALL_DIR/github-desktop-dev" ]; then
BINARY_NAME="github-desktop-dev"
else
BINARY_NAME="github-desktop"
fi
# create symbolic links to /usr/bin directory
ln -f -s "$INSTALL_DIR"/$BINARY_NAME /usr/bin || :
ln -f -s "$CLI_DIR"/github /usr/bin || :
;;

abort-upgrade|abort-remove|abort-deconfigure)
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

exit 0
23 changes: 23 additions & 0 deletions script/linux-after-remove.sh
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

PROFILE_D_FILE="/etc/profile.d/github-desktop.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}";
# remove symbolic links in /usr/bin directory
unlink /usr/bin/github-desktop || :
unlink /usr/bin/github-desktop-dev || :
unlink /usr/bin/github || :
;;

*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac

exit 0

0 comments on commit 6efb9d5

Please sign in to comment.