Skip to content

Commit

Permalink
fetch-configlet: remove wildcard from some patterns (#807)
Browse files Browse the repository at this point in the history
Better communicate to the reader that, on Windows:

- "${os}" is exactly 'zip'
- "${ext}" is exactly '.exe'
  • Loading branch information
ee7 authored Aug 22, 2023
1 parent 731c6ad commit 4d387e9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/fetch-configlet
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ main() {

local ext
case "${os}" in
windows*) ext='zip' ;;
*) ext='tar.gz' ;;
windows) ext='zip' ;;
*) ext='tar.gz' ;;
esac

echo "Fetching configlet..." >&2
Expand All @@ -70,16 +70,16 @@ main() {
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"

case "${ext}" in
*zip) unzip "${output_path}" -d "${output_dir}" ;;
*) tar xzf "${output_path}" -C "${output_dir}" ;;
zip) unzip "${output_path}" -d "${output_dir}" ;;
*) tar xzf "${output_path}" -C "${output_dir}" ;;
esac

rm -f "${output_path}"

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

local configlet_path="${output_dir}/configlet${executable_ext}"
Expand Down

0 comments on commit 4d387e9

Please sign in to comment.