Skip to content

Commit

Permalink
fetch-configlet: print success message (#689)
Browse files Browse the repository at this point in the history
Before this commit, `fetch-configlet` produced no output on success:

    $ scripts/fetch-configlet
    $ echo $?
    0

With this commit, it prints a message while downloading, and then prints
the downloaded configlet version and its location:

    $ scripts/fetch-configlet
    Fetching configlet...
    Downloaded configlet 4.0.0-beta.7 to ./bin/configlet

Closes: #459
  • Loading branch information
ee7 committed Oct 31, 2022
1 parent 0be1889 commit 5f5b54d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/fetch-configlet
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ main() {
return 1
fi

echo "Fetching configlet..." >&2
download_url="$(get_download_url)"
output_path="${output_dir}/latest-configlet.${ext}"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
Expand All @@ -69,6 +70,15 @@ main() {
esac

rm -f "${output_path}"

case "${os}" in
windows*) executable_ext='.exe' ;;
*) executable_ext='' ;;
esac

configlet_path="${output_dir}/configlet${executable_ext}"
configlet_version="$(${configlet_path} --version)"
echo "Downloaded configlet ${configlet_version} to ${configlet_path}"
}

main

0 comments on commit 5f5b54d

Please sign in to comment.