Skip to content

Instantly share code, notes, and snippets.

@pixiekat
Forked from BraINstinct0/OhMyPoshInstall.sh
Created August 4, 2024 12:43
Show Gist options
  • Save pixiekat/4f7ea523b5f4b89b0141b8f9da8bb3f5 to your computer and use it in GitHub Desktop.
Save pixiekat/4f7ea523b5f4b89b0141b8f9da8bb3f5 to your computer and use it in GitHub Desktop.
Oh My Posh install & update script for AMD64-based linux
echo "Installing 'Oh My Posh'..."
sudo wget https://www.github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
sudo chmod +x /usr/local/bin/oh-my-posh
echo "Oh My Posh installation complete. Version:"
oh-my-posh --version
#!/bin/bash
if [[ ! $(command -v jq) ]]; then
echo "Jq command not found; install with apt install jq"
exit 1
fi
remote_repo="https://github.com/JanDeDobbeleer/oh-my-posh.git"
latest_tag=$(curl -sSL https://api.github.com/repos/JanDeDobbeleer/oh-my-posh/releases/latest | jq -r '.tag_name')
current_version=$(oh-my-posh --version)
echo "Current version of 'Oh My Posh': v$current_version"
echo "Latest version of 'Oh My Posh': $latest_tag"
if [[ "$latest_tag" == "v$current_version" ]]; then
echo "Nothing to update..."
exit 1
fi
read -p "Do you want to update? (y/n): " answer
if [[ $answer =~ ^[Yy]$ ]]; then
echo "Continuing..."
sudo wget https://www.github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
sudo chmod +x /usr/local/bin/oh-my-posh
echo "Oh My Posh updated to following version:"
oh-my-posh --version
else
echo "Aborting..."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment