Skip to content

Instantly share code, notes, and snippets.

@kbtz
Forked from aelkz/[FEDORA] gitkraken
Last active September 3, 2017 03:55
Show Gist options
  • Save kbtz/40090021abfbfff34c5e3d08bce941cb to your computer and use it in GitHub Desktop.
Save kbtz/40090021abfbfff34c5e3d08bce941cb to your computer and use it in GitHub Desktop.
How to install gitkraken on Fedora 25 + launcher icon
#!/bin/bash
if [ ${USER} == "root" ]; then
echo "Don't run the entire script as root;" >&2
exit 1
fi
# Alternative link for icon file https://drive.google.com/file/d/0B-3KQ_ohu-RFVkJyS1Zfa2NLSVE/view
ICON="http://img.informer.com/icons_mac/png/128/422/422255.png"
DEFAULT_PATH=/opt
read -e -p "Choose GitKraken install path (${DEFAULT_PATH}): " INSTALL_PATH
INSTALL_PATH=${INSTALL_PATH:-$DEFAULT_PATH}
set -e
echo $INSTALL_PATH
eval "cd $INSTALL_PATH"
cd $INSTALL_PATH
# Download and extract latest version
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz
tar -xvzf gitkraken-amd64.tar.gz
rm -f gitkraken-amd64.tar.gz
# Download icon on installation folder
cd gitkraken
wget $ICON -O icon.png
# Link executable to ~/.local/bin which is by default on Fedora's $PATH
mkdir -p ~/.local/bin
EXECUTABLE=$(eval realpath $INSTALL_PATH/gitkraken/gitkraken)
ln -s EXECUTABLE ~/.local/bin
# Create app desktop entry
echo "sudo needed to create /usr/share/applications/gitkraken.desktop"
sudo tee -a /usr/share/applications/gitkraken.desktop << EOF
[Desktop Entry]
Name=GitKraken
Comment=Git Flow
Exec=$INSTALL_PATH/gitkraken/gitkraken
Icon=$INSTALL_PATH/gitkraken/icon.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;Development;
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment