-
-
Save ttonyh/644bd3d7ab982f00d53dce034ffce67f 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 | |
# Assume JQ is already installed | |
if ! builtin type -p 'yay' >/dev/null 2>&1; then | |
echo 'Install yay.' | |
TMPDIR="$(mktemp -d)" | |
cd "${TMPDIR}" || return 1 | |
DLURL=$(curl https://api.github.com/repos/Jguer/yay/releases/latest | jq -r '.assets[] | select(.name|test(".*_x86_64.tar.gz")) | .browser_download_url') | |
# Download Binary | |
YAYTAR=./$(basename $DLURL) | |
YAYDIR=./$(basename -s .tar.gz $DLURL) | |
echo "$DLURL" | |
curl -fsSLO "$DLURL" | |
tar xzvf $YAYTAR | |
cd $YAYDIR || return 1 | |
./yay -S --noconfirm yay-bin | |
cd .. | |
# Clean up | |
rm -rf $YAYDIR | |
rm -rf $TMPDIR | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment