make smarter

This commit is contained in:
Jeffrey Paul 2021-06-10 16:36:28 -07:00
parent d6fa8fd8ec
commit 4552b7cb38

21
prov.sh
View File

@ -8,8 +8,23 @@ function main() {
prov-$RELEASE prov-$RELEASE
} }
function install-jq {
if which jq >/dev/null 2>&1 ; then
return
fi
apt install -y jq
}
function install-curl {
if which curl >/dev/null 2>&1 ; then
return
fi
apt install -y curl
}
function detect-mirror-country() { function detect-mirror-country() {
apt install -y jq curl install-jq
install-curl
curl ipinfo.io | jq -r .country curl ipinfo.io | jq -r .country
} }
@ -59,6 +74,10 @@ zstd
} }
function install-age () { function install-age () {
if which age >/dev/null 2>&1 ; then
return
fi
cd /tmp cd /tmp
git clone https://filippo.io/age && cd age git clone https://filippo.io/age && cd age
go build -o . filippo.io/age/cmd/... go build -o . filippo.io/age/cmd/...