set-hyperdrivetypes-version.sh is supposed to set the python project version for hyperdrivetypes in python/hyperdrivetypes/pyproject.toml to be the same as the version specified in contracts/src/libraries/Constants.sol. It works locally, and used to work in CI, but is now failing:
/bin/sh: 17: scripts/set-hyperdrivetypes-version.sh: [[: not found
writing to python/hyperdrivetypes/pyproject.toml
/bin/sh: 20: scripts/set-hyperdrivetypes-version.sh: [[: not found
Unsupported OS:
make[1]: Leaving directory '/home/runner/work/hyperdrive/hyperdrive'
the error had an empty string for $OSTYPE
Unsupported OS:
Here's the script:
#!/bin/bash
echo "get hyperdrive version"
# Extract version using sed by reading from the file
HYPERDRIVE_FILE="contracts/src/libraries/Constants.sol"
VERSION=$(sed -n -E 's/.*VERSION = "v([0-9]+\.[0-9]+\.[0-9]+)".*/\1/p' "$HYPERDRIVE_FILE")
# Determine the OS using uname and convert to lowercase
OS_TYPE=$(uname | tr '[:upper:]' '[:lower:]')
# Append the version to hyperdrivetypes
HYPERDRIVETYPES_FILE="python/hyperdrivetypes/pyproject.toml"
echo "found version: v$VERSION"
echo "writing to $HYPERDRIVETYPES_FILE"
# Check the operating system to use the correct sed syntax
if [[ "$OSTYPE" == "darwin"* ]]; then
# e.g. macOS
sed -i '' -E "s/^(version = \")[0-9]+\.[0-9]+\.[0-9]+(\.*[0-9]*\".*)/\1$VERSION\2/" "$HYPERDRIVETYPES_FILE"
elif [[ "$OSTYPE" == "linux"* ]]; then
# e.g. Ubuntu
sed -i -E "s/^(version = \")[0-9]+\.[0-9]+\.[0-9]+(\.*[0-9]*\".*)/\1$VERSION\2/" "$HYPERDRIVETYPES_FILE"
else
echo "Unsupported OS: $OSTYPE"
# exit 1
fi
which I guess means uname | tr '[:upper:]' '[:lower:]' failed... maybe the container doesn't have uname installed?
set-hyperdrivetypes-version.sh
is supposed to set the python project version forhyperdrivetypes
inpython/hyperdrivetypes/pyproject.toml
to be the same as the version specified incontracts/src/libraries/Constants.sol
. It works locally, and used to work in CI, but is now failing:the error had an empty string for
$OSTYPE
Here's the script:
which I guess means
uname | tr '[:upper:]' '[:lower:]'
failed... maybe the container doesn't have uname installed?