Last active
October 2, 2021 20:35
-
-
Save macchaberrycream/dacb5aa930c600db335845ffa448f5c7 to your computer and use it in GitHub Desktop.
[install yay shell script] #ArchLinux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# yay | |
# Yet another Yogurt - An AUR Helper written in Go | |
# <https://github.com/Jguer/yay> | |
if ! builtin type -p 'yay' >/dev/null 2>&1; then | |
echo 'Install yay.' | |
sudo pacman -S --needed base base-devel wget | |
tmpdir="$(command mktemp -d)" | |
command cd "${tmpdir}" || return 1 | |
dl_url="$( | |
command curl -sfLS 'https://api.github.com/repos/Jguer/yay/releases/latest' | | |
command grep 'browser_download_url' | | |
command cut -d '"' -f 4 | |
)" | |
command wget "${dl_url}" | |
command tar xzvf yay_*_x86_64.tar.gz | |
command cd yay_*_x86_64 || return 1 | |
./yay -Sy yay-bin | |
rm -rf "${tmpdir}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This fails becuase the first match of grep is for aarch64:
I fixed it with
curl -sfLS 'https://api.github.com/repos/Jguer/yay/releases/latest' | grep 'browser_download_url' | tail -1 | cut -d '"' -f 4