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