Skip to content

Instantly share code, notes, and snippets.

@pooyagolchian
Last active September 3, 2019 06:54
Show Gist options
  • Save pooyagolchian/12b1ddd15679aaf0c3e1730c930877bb to your computer and use it in GitHub Desktop.
Save pooyagolchian/12b1ddd15679aaf0c3e1730c930877bb to your computer and use it in GitHub Desktop.
Install last version of Postman with desktop entry - Ubuntu
#!/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