Debugging

This commit is contained in:
Core 2022-08-04 17:50:00 +01:00
parent cd7f85ea25
commit eec0b19f10
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6

View file

@ -1,14 +1,22 @@
#!/bin/bash #!/bin/bash
# Setup the variables needed
STABLE_SHA=$(curl -s https://api.github.com/repos/ciderapp/Cider/branches/stable | grep '"sha"' | head -1 | cut -d '"' -f 4) STABLE_SHA=$(curl -s https://api.github.com/repos/ciderapp/Cider/branches/stable | grep '"sha"' | head -1 | cut -d '"' -f 4)
SHA_DATE=$(git show -s --format=%ci $STABLE_SHA) SHA_DATE=$(git show -s --format=%ci $STABLE_SHA)
COMMITSINCESTABLE=$(git rev-list $STABLE_SHA..HEAD --count --since="$SHA_DATE") COMMIT_SINCE_STABLE=$(git rev-list $STABLE_SHA..HEAD --count --since="$SHA_DATE")
CURRENT_VERSION=$(node -p -e "require('./package.json').version") CURRENT_VERSION=$(node -p -e "require('./package.json').version")
LATEST_VERSION=$(curl -s https://api.github.com/repos/ciderapp/cider-releases/releases/latest | grep tag_name | cut -d '"' -f 4 | sed 's/v//' | xargs) LATEST_VERSION=$(curl -s https://api.github.com/repos/ciderapp/cider-releases/releases/latest | grep tag_name | cut -d '"' -f 4 | sed 's/v//' | xargs)
# Debugging
echo "STABLE_SHA: $STABLE_SHA"
echo "SHA_DATE: $SHA_DATE"
echo "COMMIT_SINCE_STABLE: $COMMIT_SINCE_STABLE"
echo "CURRENT_VERSION: $CURRENT_VERSION"
echo "LATEST_VERSION: $LATEST_VERSION"
# Set the version number for commits on main branch # Set the version number for commits on main branch
if [[ ($CIRCLE_BRANCH == "main" || $GITHUB_REF_NAME == "main") && $COMMITSINCESTABLE -gt 0 ]]; then if [[ ($CIRCLE_BRANCH == "main" || $GITHUB_REF_NAME == "main") && $COMMIT_SINCE_STABLE -gt 0 ]]; then
NEW_VERSION="${CURRENT_VERSION}-beta.${COMMITSINCESTABLE}" NEW_VERSION="${CURRENT_VERSION}-beta.${COMMIT_SINCE_STABLE}"
# This is shit # This is shit
if [[ $GITHUB_REF_NAME == "main" && $CURRENT_VERSION == $NEW_VERSION ]]; then if [[ $GITHUB_REF_NAME == "main" && $CURRENT_VERSION == $NEW_VERSION ]]; then