Skip to content

Instantly share code, notes, and snippets.

@macchaberrycream
Last active October 2, 2021 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save macchaberrycream/dacb5aa930c600db335845ffa448f5c7 to your computer and use it in GitHub Desktop.
Save macchaberrycream/dacb5aa930c600db335845ffa448f5c7 to your computer and use it in GitHub Desktop.
[install yay shell script] #ArchLinux
#!/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
@Bouni
Copy link

Bouni commented Dec 6, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment