Skip to content

Instantly share code, notes, and snippets.

@MggMuggins MggMuggins/
Last active Aug 10, 2017

What would you like to do?
My tool for installing packages from the AUR. Rename to "yam" and install in /usr/local/bin if you so desire for easy execution.
# Sources are placed in $HOME/.local/share/yam
# by default. I'll add better argument parsing
# and an option to change it later
set install false
set srcdir $HOME/.local/share/yam/
for arg in $argv
switch "$arg"
case "-i" "--install"
set install true
case "*"
set tarball_full "$arg"
echo $install
echo $tarball_full
if not test -f "$tarball_full"
echo "File does not exist"
exit 1
if not test -d "$srcdir"
mkdir "$srcdir"
set tarball (basename $tarball_full)
set filename (basename $tarball_full ".tar.gz")
echo $tarball
echo $filename
mv $tarball_full $srcdir
cd $srcdir
tar -xvf $tarball
rm $tarball
cd $filename
makepkg -s
if test $install = true
sudo pacman -U *.tar.xz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.