Skip to content

Instantly share code, notes, and snippets.

@khiemdoan
Last active May 26, 2018 14:40
Show Gist options
  • Save khiemdoan/e7870e5532616aba7792d0bbf11bb229 to your computer and use it in GitHub Desktop.
Save khiemdoan/e7870e5532616aba7792d0bbf11bb229 to your computer and use it in GitHub Desktop.
Postman Installer for Ubuntu
#!/bin/sh
# Auto install Postman
# Khiem Doan <[email protected]>
# use for Ubuntu
postman_download_url='https://dl.pstmn.io/download/latest/linux64'
file_name='/tmp/postman-linux-x64.tar.gz'
destination_dir='/usr/share/postman'
symbolic_link='/usr/bin/postman'
# download
wget $postman_download_url -O $file_name
# install
tar xvf $file_name -C /tmp
echo "Installing..."
if [ -d $destination_dir ];then
sudo rm -rf $destination_dir
fi
sudo mv /tmp/Postman $destination_dir
rm $file_name
echo "Creating symbolic link..."
if [ -L "/usr/bin/postman" ];then
sudo rm -f $symbolic_link
fi
sudo ln -s $destination_dir/Postman $symbolic_link
# create launcher icon
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/usr/share/postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
EOL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment