Skip to content

Commit

Permalink
Update script formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tong committed Oct 5, 2024
1 parent e533a05 commit c332a5c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions update.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/usr/bin/env bash

if [ -z "$1" ]; then
next=$(gh release list --repo electron/electron --limit 1 --exclude-drafts | awk '{print $2}')
next=$(gh release list --repo electron/electron --limit 1 --exclude-drafts | awk '{print $2}')
else
next=$1
next=$1
fi

#current=$(git describe --tags --abbrev=0)
current=$(jq -r '.version' haxelib.json)
current=$(jq -r '.version' haxelib.json)
prerelease_version=$(echo $next | awk -F'-' '{print $2}')

if [[ -n "$prerelease_version" ]]; then
echo "Aborting update since latest version is a pre-release ($next)"
exit 1
echo "Aborting update since latest version is a pre-release ($next)"
exit 1
fi

if [ "$current" = "$next" ]; then
echo "No new version available"
exit 1
echo "No new version available"
exit 1
fi

echo "Updating from $current -> $next"
Expand All @@ -29,10 +29,10 @@ haxe api.hxml
echo "Building haxedoc.xml"
haxe haxedoc.hxml
echo "Updating haxelib.json"
cat <<< "$(jq --arg var "$(echo "$next" | cut -c2-)" '.version = $var' haxelib.json)" > tmpfile && mv tmpfile haxelib.json
cat <<<"$(jq --arg var "$(echo "$next" | cut -c2-)" '.version = $var' haxelib.json)" >tmpfile && mv tmpfile haxelib.json
echo "Updating demo/package.json"
cd demo || exit 1
cat <<< "$(jq --arg var "$next" '.devDependencies.electron = $var' package.json)" > tmpfile && mv tmpfile package.json
cat <<<"$(jq --arg var "$next" '.devDependencies.electron = $var' package.json)" >tmpfile && mv tmpfile package.json
npm install
cd - || exit 1
exit 0

0 comments on commit c332a5c

Please sign in to comment.