File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ function help(){
4+ echo " miniscript-run '<miniscript>'" ;
5+ echo " miniscript-run 'pk_h(test)'" ; exit
6+ }
7+ if [[ " $1 " == " help" ]] || [[ " $1 " == " -h" ]]; then
8+ help ; exit
9+ fi
10+
11+ function install(){
12+
13+ [ ! -d miniscript ] && \
14+ $( which git) clone --depth 1 https://github.com/sipa/miniscript.git
15+
16+ cd miniscript && \
17+ make > /dev/null && \
18+ install miniscript /usr/local/bin 2> /dev/null && \
19+ file miniscript && \
20+ cd .. || file echo $( which miniscript) ;
21+
22+ [[ -z " $( command -v miniscript-run) " ]] && \
23+ install $0 /usr/local/bin || \
24+ echo $( which miniscript-run) ; exit
25+ }
26+ if [[ " $1 " == " install" ]]; then
27+ install; exit
28+ fi
29+ #
30+ for var in " $@ "
31+ do
32+ echo " $var " | $( which miniscript) 2> /dev/null; exit || \
33+ echo " $var " | ./miniscript/miniscript; exit || help
34+ done
35+ help
You can’t perform that action at this time.
0 commit comments