Skip to content

Instantly share code, notes, and snippets.

@Jekis
Last active March 5, 2019 07:43
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Jekis/722e286251eab7fc4e9b2caf732cf16d to your computer and use it in GitHub Desktop.
Save Jekis/722e286251eab7fc4e9b2caf732cf16d to your computer and use it in GitHub Desktop.
Download and install the latest version of Postman for Ubuntu. Create .desktop file.
#!/bin/bash
INSTALL_DIR=/opt/postman
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root. Use sudo!"
exit 1
fi
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 > /usr/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=$INSTALL_DIR/app/resources/app/assets/icon.png
Type=Application
StartupNotify=false
OnlyShowIn=Unity;
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