-
Notifications
You must be signed in to change notification settings - Fork 4
/
vsp
executable file
·45 lines (33 loc) · 815 Bytes
/
vsp
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
#!/bin/bash
ARGS=$(getopt --options cvh --long "check,version,help" -- "$@")
eval set --"$ARGS"
check="false"
version="false"
help="false"
while true; do
case "$1" in
-c|--check)
check="true"
shift;;
-v|--version)
version="true"
shift;;
-h|--help)
help="true"
shift;;
--)
shift
break;;
esac
done
search="$(ls "$HOME"/.local/pkgs/void-packages/srcpkgs | grep "$1")"
if [ "$check" == true ]; then
avail="$(ls "$HOME"/.local/pkgs/void-packages/srcpkgs | grep "$1" | wc -l)"
if [ "$avail" -gt 0 ]; then
echo "$search"
fi
fi
if [ "$version" == true ]; then
ver=$(grep version= ~/.local/pkgs/void-packages/srcpkgs/"$1"/template)
echo "$ver"
fi