Skip to content

Commit

Permalink
fix shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmann committed Aug 20, 2024
1 parent db7102e commit 0f2a492
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions updateToNewestRelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
token=$(git config --global github.token)

json=$(http https://api.github.com/repos/indigo-dc/oidc-agent/releases/latest "Authorization: Bearer ${token}")
tag=$(echo $json | jq -r '.tag_name')
tag=$(echo "$json" | jq -r '.tag_name')

Check failure on line 6 in updateToNewestRelease.sh

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

Prefer putting braces around variable references even when not strictly required.
version=${tag/#v/}

$(dirname $0)/updateToRelease.sh $version $1
"$(dirname "$0")"/updateToRelease.sh "$version" "$1"
11 changes: 6 additions & 5 deletions updateToRelease.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#!/bin/bash

token=$(git config --global github.token)
export token

version=$1
tag="v$version"

Check failure on line 7 in updateToRelease.sh

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

Prefer putting braces around variable references even when not strictly required.
formula=$2

git checkout -b "$version"

Check failure on line 10 in updateToRelease.sh

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

Prefer putting braces around variable references even when not strictly required.

tar_url=$(echo "https://github.com/indigo-dc/oidc-agent/archive/refs/tags/VTAG.tar.gz" | sed "s/VTAG/"${tag}"/g")
sha256=$(curl -L $tar_url 2>/dev/null| sha256sum | awk '{print $1}')
tar_url=$(echo "https://github.com/indigo-dc/oidc-agent/archive/refs/tags/VTAG.tar.gz" | sed \"s/VTAG/"${tag}"/g\")
sha256=$(curl -L "$tar_url" 2>/dev/null| sha256sum | awk '{print $1}')

Check failure on line 13 in updateToRelease.sh

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).

Check failure on line 13 in updateToRelease.sh

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

Prefer putting braces around variable references even when not strictly required.

Check failure on line 13 in updateToRelease.sh

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).

sed -i "s!^[[:space:]]*url\ \".*\"! url\ \"${tar_url}\"!g" $formula
sed -i "s/sha256\ \".*\"/sha256\ \"${sha256}\"/g" $formula
sed -i "s!^[[:space:]]*url\ \".*\"! url\ \"${tar_url}\"!g" "$formula"

Check failure on line 15 in updateToRelease.sh

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

Prefer putting braces around variable references even when not strictly required.
sed -i "s/sha256\ \".*\"/sha256\ \"${sha256}\"/g" "$formula"

Check failure on line 16 in updateToRelease.sh

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

Prefer putting braces around variable references even when not strictly required.

echo "Updated url to: ${tar_url}"
echo "Updated sha256 to: ${sha256}"

git add "$formula"

Check failure on line 21 in updateToRelease.sh

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

Prefer putting braces around variable references even when not strictly required.
git commit -m ""${version}""
git commit -m \""${version}"\"

0 comments on commit 0f2a492

Please sign in to comment.