-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminiscript-run
More file actions
executable file
·58 lines (36 loc) · 1007 Bytes
/
miniscript-run
File metadata and controls
executable file
·58 lines (36 loc) · 1007 Bytes
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
58
#!/usr/bin/env bash
[[ -z "$(command -v miniscript-run)" ]] && install $0 /usr/local/bin >/dev/null || true
function help(){
echo "miniscript-run '<miniscript>'";
echo "miniscript-run 'pk_h(test)'";exit
}
if [[ "$1" == "help" ]] || [[ "$1" == "-h" ]]; then
help; exit
fi
function install-miniscript(){
if [ -d "miniscript" ] ; then
echo "miniscript is a directory";
rm -rf miniscript
else
if [ -f "miniscript" ] ; then
if [[ ! -z "$(file miniscript | grep linux)" ]]; then
true;
else
rm -f miniscript
fi
fi
make miniscript && install ./miniscript /usr/local/bin 2>/dev/null
fi
}
if [[ "$1" == "install" ]]; then
install-miniscript; exit
fi
#
for var in "$@"
do
#echo "var=$var"
echo "$var" | $(which miniscript); exit || \
#echo "$var" | sed "s/\'//g"
echo "$var" | sed "s/\'//g" | $(which miniscript) 2>/dev/null; exit
done
help