tools fmt
This commit is contained in:
parent
35fb1fc84b
commit
ec3556e91b
1 changed files with 40 additions and 45 deletions
15
tools.sh
15
tools.sh
|
@ -10,7 +10,7 @@ post_download_install() {
|
||||||
|
|
||||||
tool=$1
|
tool=$1
|
||||||
temp_file=$(mktemp -p . ${tool}.XXX.sh)
|
temp_file=$(mktemp -p . ${tool}.XXX.sh)
|
||||||
key=$tool yq e 'explode(.) | .[env(key)].post-download' $YAMLDOC > $temp_file
|
key=$tool yq e 'explode(.) | .[env(key)].post-download' $YAMLDOC >$temp_file
|
||||||
. $temp_file
|
. $temp_file
|
||||||
rm $temp_file
|
rm $temp_file
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ eget_tool() {
|
||||||
eget $user/$tool \
|
eget $user/$tool \
|
||||||
${asset:+--asset $asset} \
|
${asset:+--asset $asset} \
|
||||||
${file:+--file $file} \
|
${file:+--file $file} \
|
||||||
${to:+--to $to}\
|
${to:+--to $to} \
|
||||||
${download_only:+--download-only} \
|
${download_only:+--download-only} \
|
||||||
-q
|
-q
|
||||||
|
|
||||||
|
@ -44,14 +44,11 @@ eget_tool() {
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ! $(is-executable eget); then
|
if ! $(is-executable eget); then
|
||||||
echo "I don't see eget on your path..."
|
echo "I don't see eget on your path..."
|
||||||
read -p "Do you want to download it to ${BIN_DIR}? " -n 1 -r
|
read -p "Do you want to download it to ${BIN_DIR}? " -n 1 -r
|
||||||
echo # (optional) move to a new line
|
echo # (optional) move to a new line
|
||||||
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||||
then
|
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
curl https://zyedidia.github.io/eget.sh | sh
|
curl https://zyedidia.github.io/eget.sh | sh
|
||||||
|
@ -65,13 +62,12 @@ if ! $(is-executable yq); then
|
||||||
eget mikefarah/yq --asset yq_linux_amd64
|
eget mikefarah/yq --asset yq_linux_amd64
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if ! [ -z "$1" ]; then
|
if ! [ -z "$1" ]; then
|
||||||
tool=$1
|
tool=$1
|
||||||
|
|
||||||
echo "installing $tool"
|
echo "installing $tool"
|
||||||
info=$(key=$tool yq e 'explode(.) | .[env(key)]' $YAMLDOC)
|
info=$(key=$tool yq e 'explode(.) | .[env(key)]' $YAMLDOC)
|
||||||
if [[ "$info" == "null" ]]; then
|
if [[ $info == "null" ]]; then
|
||||||
echo "$tool not found in $YAMLDOC"
|
echo "$tool not found in $YAMLDOC"
|
||||||
echo "exiting"
|
echo "exiting"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -85,7 +81,6 @@ echo "no tool specified installing everything"
|
||||||
|
|
||||||
readarray tools < <(yq e 'keys | .[]' $YAMLDOC)
|
readarray tools < <(yq e 'keys | .[]' $YAMLDOC)
|
||||||
|
|
||||||
for tool in "${tools[@]:1}"
|
for tool in "${tools[@]:1}"; do
|
||||||
do
|
|
||||||
eget_tool $tool
|
eget_tool $tool
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue