blob: 9f463da40b01ac1da7ad6a8b888cb6f73206fd6d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#!/bin/bash
# Completely gitless aur helper, AurKeinGit
# Made by: zyriu1 <mdawid581 at gmail dot com>
if [ ! -d ~/.akg ]; then
mkdir ~/.akg
fi
cd ~/.akg
if [[ $1 = "-Q" ]]; then
akg -R $2 && akg -S $2
exit
fi
if [[ $1 = "-Ss" ]]; then
curl "https://aur.archlinux.org/rpc/v5/search/$2" -s > search
count=$(cat ./search | jq -r .resultcount)
if [[ $count -eq 0 ]]; then
echo Can\'t find $2!
exit
fi
for ((i = 0 ; i < count ; i++)); do
echo $i: $(cat ./search | jq -r .results.[$i].Name) /// $(cat ./search | jq -r .results.[$i].Description)
echo
done
read -p "Pick package index: " index
akg -S $(cat ./search | jq -r .results.[$index].Name)
exit
fi
if [[ $1 = "--help" ]]; then
echo "Usage: akg [OPTIONS] [PACKAGE NAME]"
echo "AurKeinGit(no, im not german), an aur helper that doesn't use git clone."
echo "OPTIONS: -S - install, -R - remove, -Q - reinstall, -Ss - search"
exit
fi
if [[ $1 = "-R" ]]; then
sudo pacman -R "$2"
exit
fi
if [[ $1 = "-S" ]]; then
wget "https://aur.archlinux.org/cgit/aur.git/snapshot/$2.tar.gz"
if [ ! -f ./$2.tar.gz ]; then
echo Error, couldn\'t find file package $2!
exit
fi
tar -xzxf "$2.tar.gz"
rm "$2.tar.gz"
cd "$2"
makepkg -si
echo Cleaning up...
cd ..
rm -rf "$2"
echo "Done!"
exit
fi
echo Error, not enough arguments! try \"akg --help\".
|