Skip to content

Commit 0f2a492

Browse files
committed
fix shellcheck
1 parent db7102e commit 0f2a492

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

updateToNewestRelease.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
token=$(git config --global github.token)
44

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

9-
$(dirname $0)/updateToRelease.sh $version $1
9+
"$(dirname "$0")"/updateToRelease.sh "$version" "$1"

updateToRelease.sh

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
#!/bin/bash
22

33
token=$(git config --global github.token)
4+
export token
45

56
version=$1
67
tag="v$version"
78
formula=$2
89

910
git checkout -b "$version"
1011

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

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

1718
echo "Updated url to: ${tar_url}"
1819
echo "Updated sha256 to: ${sha256}"
1920

2021
git add "$formula"
21-
git commit -m ""${version}""
22+
git commit -m \""${version}"\"

0 commit comments

Comments
 (0)