Skip to content

Commit

Permalink
fix: updating urls to in-toto from testifysec and -L to the cur…
Browse files Browse the repository at this point in the history
…l for version (#297)

* fix: updating urls to `in-toto` from `testifysec`

* fix: incorporating change from #295 that fixes #263

---------

Co-authored-by: John Kjell <[email protected]>
  • Loading branch information
lmco-seth and jkjell authored Nov 14, 2023
1 parent b3d7207 commit 2219a76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions install-witness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [ ! -d $INSTALL_DIR ]; then
fi

# Get the latest version of Witness
VERSION=$(curl -s https://api.github.com/repos/testifysec/witness/releases/latest | grep -o '"tag_name": *"[^"]*"' | sed 's/"//g' | sed 's/tag_name: *//')
VERSION=$(curl -L -s https://api.github.com/repos/in-toto/witness/releases/latest | grep -o '"tag_name": *"[^"]*"' | sed 's/"//g' | sed 's/tag_name: *//')

#remove the 'v' from the version
readonly VERSION=${VERSION:1}
Expand All @@ -59,8 +59,8 @@ OS=$(uname -s)
## change to lowercase
OS=$(echo "$OS" | tr '[:upper:]' '[:lower:]')
FILENAME="witness_${VERSION}_${OS}_${ARCH}.tar.gz"
DOWNLOAD_URL="https://github.com/testifysec/witness/releases/download/v$VERSION/$FILENAME"
EXPECTED_CHECKSUM="$(curl -L -s https://github.com/testifysec/witness/releases/download/v$VERSION/witness_${VERSION}_checksums.txt | grep -w "witness_${VERSION}_${OS}_$ARCH.tar.gz$" | awk '{print $1}')"
DOWNLOAD_URL="https://github.com/in-toto/witness/releases/download/v$VERSION/$FILENAME"
EXPECTED_CHECKSUM="$(curl -L -s https://github.com/in-toto/witness/releases/download/v$VERSION/witness_${VERSION}_checksums.txt | grep -w "witness_${VERSION}_${OS}_$ARCH.tar.gz$" | awk '{print $1}')"
readonly EXPECTED_CHECKSUM EXPECTED_CHECKSUM

echo "Latest version of Witness is $VERSION"
Expand Down

0 comments on commit 2219a76

Please sign in to comment.