Skip to content

Commit

Permalink
Minor bash improvements suggested by shellcheck.
Browse files Browse the repository at this point in the history
  • Loading branch information
MirahImage committed Mar 17, 2021
1 parent b6a0068 commit eacf2fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hack/add-notice-to-yaml.sh
Expand Up @@ -3,7 +3,7 @@
set -e

TARGET_YAML=$1
SCRIPT_DIR="$(dirname $0)"
SCRIPT_DIR="$(dirname "$0")"

if [[ -z $TARGET_YAML ]]
then
Expand Down
8 changes: 4 additions & 4 deletions hack/generate-ordered-api-reference-list.sh
Expand Up @@ -18,15 +18,15 @@ tail='^<!--- END API REFERENCE LIST -->$'
unorderedlistfile="$(mktemp)"
orderedlistfile="$(mktemp)"

apiVersions="$(find $wikiDir/API_Reference_* -printf "%f\n" | sed -r 's/API_Reference_(v[0-9]+.[0-9]+.[0-9]+).asciidoc/\1/' | sort -Vr )"
apiVersions="$(find "$wikiDir/API_Reference_*" -printf "%f\n" | sed -r 's/API_Reference_(v[0-9]+.[0-9]+.[0-9]+).asciidoc/\1/' | sort -Vr )"
for version in $apiVersions
do
echo "$(generateVersionedEntry $version)" >> $unorderedlistfile
generateVersionedEntry "$version" >> "$unorderedlistfile"
done

# Latest API version is a special case, that is always top of the list
generateLatestEntry > $orderedlistfile
cat $unorderedlistfile >> $orderedlistfile
generateLatestEntry > "$orderedlistfile"
cat "$unorderedlistfile" >> "$orderedlistfile"

sed -e "/$lead/,/$tail/{ /$lead/{p; r $orderedlistfile
}; /$tail/p; d }" "$wikiDir/Wiki_Sidebar.md"

0 comments on commit eacf2fc

Please sign in to comment.