Last active
September 3, 2019 06:54
-
-
Save pooyagolchian/12b1ddd15679aaf0c3e1730c930877bb to your computer and use it in GitHub Desktop.
Install last version of Postman with desktop entry - Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INSTALL_DIR=/opt/postman | |
if [ "$(whoami)" != "root" ] | |
then | |
echo "Sorry, you are not root. Use sudo!" | |
exit 1 | |
fi | |
echo "Install libgconf-2-4 package " | |
apt-get install libgconf-2-4 -y | |
echo "Downloading the latest Postman to /tmp" | |
cd /tmp | |
curl -Lo postman.tar.gz "https://dl.pstmn.io/download/latest/linux64" | |
tar -xzf /tmp/postman.tar.gz | |
rm /tmp/postman.tar.gz | |
echo "Removing old Postman..." | |
rm -rf $INSTALL_DIR | |
echo "Copying new Postman..." | |
mv /tmp/Postman* $INSTALL_DIR | |
ln -sf $INSTALL_DIR/Postman /usr/bin/postman | |
echo "Creating postman.desktop file..." | |
cat > ~/.local/share/applications/Postman.desktop <<EOL | |
[Desktop Entry] | |
Version=1.0 | |
Name=Postman | |
Comment=Postman Desktop | |
Exec=$INSTALL_DIR/Postman | |
Path=$INSTALL_DIR | |
Icon=$INSTALL_DIR/app/resources/app/assets/icon.png | |
Terminal=false | |
Type=Application | |
Categories=Development; | |
EOL | |
echo "New Postman has been installed!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment