Skip to content

Commit

Permalink
Fix update website script to be able to run Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphr committed Jul 20, 2024
1 parent 6365a60 commit0f24633
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/scripts/update-website.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,34 @@ STABLE_VERSION=`grep stableVersion config.toml | sed 's/.* "\(.*\)" /\1/'`
MAJOR_MINOR_STABLE_VERSION=$(computeMajorMinorVersion$STABLE_VERSION)

echo"📝 Updating versions"
sed -i''-e"s/^devVersion =\ "\(.*\)\ "/devVersion =\ "${VERSION}\ "/g"config.toml

SEDOPTION="-i"
if[["$OSTYPE"=="darwin"*]];then
SEDOPTION="-i ''"
fi

sed$SEDOPTION-e"s/^devVersion =\ "\(.*\)\ "/devVersion =\ "${VERSION}\ "/g"config.toml

if["${STABLE}"=="yes"];then
sed-i''-e"s/^stableVersion =\ "\(.*\)\ "/stableVersion =\ "${VERSION}\ "/g"config.toml
sed$SEDOPTION-e"s/^stableVersion =\ "\(.*\)\ "/stableVersion =\ "${VERSION}\ "/g"config.toml
if["${MAJOR_MINOR_STABLE_VERSION}"!=${MAJOR_MINOR_VERSION}];then
echo"📝 Updating new stable version"
#This means that we have a new stable version and we need to change the order of the releases.
sed-i''-e"s/^order = \(.*\)/order = 500/g"data/releases/${MAJOR_MINOR_VERSION}.toml
sed$SEDOPTION-e"s/^order = \(.*\)/order = 500/g"data/releases/${MAJOR_MINOR_VERSION}.toml
NEXT_STABLE_ORDER=$((`ls-1data/releases|wc-l`-2))
sed-i''-e"s/^order = \(.*\)/order =${NEXT_STABLE_ORDER}/g"data/releases/${MAJOR_MINOR_STABLE_VERSION}.toml
sed$SEDOPTION-e"s/^order = \(.*\)/order =${NEXT_STABLE_ORDER}/g"data/releases/${MAJOR_MINOR_STABLE_VERSION}.toml
git add data/releases/${MAJOR_MINOR_STABLE_VERSION}.toml
fi
elif["${MAJOR_MINOR_DEV_VERSION}"!="${MAJOR_MINOR_VERSION}"];then
echo"📝 Updating new dev version"
#This means that we are updating for a new dev version, but the last dev version is not the one that we are doing.
#Therefore, we need to update add the new data configuration
cp data/releases/${MAJOR_MINOR_DEV_VERSION}.toml data/releases/${MAJOR_MINOR_VERSION}.toml
sed-i''-e"s/^order = \(.*\)/order = 1000/g"data/releases/${MAJOR_MINOR_VERSION}.toml
sed$SEDOPTION-e"s/^order = \(.*\)/order = 1000/g"data/releases/${MAJOR_MINOR_VERSION}.toml
fi

sed-i''-e"s/^name =\ "\(.*\)\ "/name =\ "${VERSION}\ "/g"data/releases/${MAJOR_MINOR_VERSION}.toml
sed-i''-e"s/^releaseDate = \(.*\)/releaseDate =$(date +%F)/g"data/releases/${MAJOR_MINOR_VERSION}.toml
sed$SEDOPTION-e"s/^name =\ "\(.*\)\ "/name =\ "${VERSION}\ "/g"data/releases/${MAJOR_MINOR_VERSION}.toml
sed$SEDOPTION-e"s/^releaseDate = \(.*\)/releaseDate =$(date +%F)/g"data/releases/${MAJOR_MINOR_VERSION}.toml
git add data/releases/${MAJOR_MINOR_VERSION}.toml
git add config.toml

Expand Down

0 comments on commit0f24633

Please sign into comment.