postman rework

This commit is contained in:
Anthony Axenov 2024-07-31 23:36:02 +08:00
parent 4014f83402
commit 479ac2064f
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC

View File

@ -1,28 +1,33 @@
#!/bin/bash #!/bin/bash
##makedesc: Install postman (latest) ##makedesc: Install postman (latest)
source `dirname $0`/../helpers || exit 255
echo # https://learning.postman.com/docs/getting-started/installation-and-updates/#installing-postman-on-linux
echo "==============================================="
echo "Installing postman (latest)..."
echo "==============================================="
echo
mkdir -p ${HOME}/install/postman # set -ex
mkdir -p ${HOME}/.local/bin
wget "https://dl.pstmn.io/download/latest/linux64" -O ${HOME}/install/postman.tar.gz && \
tar -xzf ${HOME}/install/postman.tar.gz -C ${HOME}/install/postman && \
ln -sf ${HOME}/install/postman/Postman/Postman ${HOME}/.local/bin/postman && \
mkdir -p "${HOME}/.local/share/applications" && \
cat << EOF > "${HOME}/.local/share/applications/Postman.desktop"
#!/usr/bin/env xdg-open
title
mkdir -p "$HOME/install" && \
"$HOME/.local/bin" && \
"$HOME/.local/share/applications"
download "https://dl.pstmn.io/download/latest/linux64" "$HOME/install/postman.tar.gz" && \
unpak_targz "$HOME/install/postman.tar.gz" "$HOME/install" && \
symlink "$HOME/install/Postman/Postman" "$HOME/.local/bin/postman" && \
cat << EOF > "$HOME/.local/share/applications/Postman.desktop" && sudo update-desktop-database
[Desktop Entry] [Desktop Entry]
Name=Postman Name=Postman
Exec=${HOME}/.local/bin/postman Exec=$HOME/.local/bin/postman %U
Icon=${HOME}/install/postman/Postman/app/icons/icon_128x128.png Icon=$HOME/install/Postman/app/icons/icon_128x128.png
Categories=Utility,Network Categories=Development,Network
Terminal=false Terminal=false
Type=Application Type=Application
Encoding=UTF-8 Encoding=UTF-8
EOF EOF
sudo update-desktop-database
[ $? = 0 ] && {
echo
success "Postman installed!"
echo
}