looztra / asdf-stern

stern (https://github.com/wercker/stern) plugin for asdf
Apache License 2.0
4 stars 3 forks source link

chore: refactor #6

Closed looztra closed 3 years ago

github-actions[bot] commented 3 years ago

sh-checker report

shellcheck output ``` No errors or shellcheck is disabled ```

The files above have some shellcheck issues

shfmt output ``` --- bin/list-all.orig +++ bin/list-all @@ -1,21 +1,21 @@ #!/usr/bin/env bash github_coordinates=stern/stern releases_path="https://api.github.com/repos/${github_coordinates}/releases" cmd="curl -s" if [ -n "$GITHUB_API_TOKEN" ]; then cmd="$cmd -H 'Authorization: token $GITHUB_API_TOKEN'" fi cmd="$cmd $releases_path" # stolen from https://github.com/rbenv/ruby-build/pull/631/files#diff-fdcfb8a18714b33b07529b7d02b54f1dR942 function sort_versions() { - sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z\1/; s/$/.z/; G; s/\n/ /' \ - | LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}' + sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z\1/; s/$/.z/; G; s/\n/ /' | + LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}' } # Fetch all tag names, and get only second column. Then remove all unnecesary characters. versions=$(eval "$cmd" | sed -n -e 's/.*"tag_name".*:.*"v\(.*\)",$/\1/p' | sed 's/tag_name\": *\"//;s/\",//' | sort_versions) # shellcheck disable=SC2086 echo $versions ```

The files above have some formatting problems, you can use shfmt -w to fix them

To get the full details about this job