Skip to content

Commit

Permalink
refactor to a set_snapshot branch
Browse files Browse the repository at this point in the history
  • Loading branch information
basejump committed Jun 26, 2022
1 parent 539dd5c commit 801c65a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions bin/init_env
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ function init_defaults {
# make sure they can't ever get set to snapshot=false
setVar RELEASE_DEV_BRANCH_REGEX "dev"
if [[ "${ACTIVE_BRANCH:-}" =~ ^(${RELEASE_DEV_BRANCH_REGEX})$ && $(bool "${IS_SNAPSHOT:-}") = false ]]; then
echo "version.snapshot MUST ALWAYS BE FALSE on dev branch"
return 1
echo "****** version.snapshot SHOULD BE FALSE on dev branch"
echo "****** Setting IS_SNAPSHOT=true since on dev branch"
set_snapshot
fi

# shellcheck disable=SC2034
Expand Down Expand Up @@ -196,15 +197,19 @@ function init_versions {

# if its a snapshot then append the SNAPSHOT
if truthy "${snapshot:-}"; then
putVar VERSION_SUFFIX "-SNAPSHOT"
putVar IS_SNAPSHOT true
BUILD_VERSION+="-SNAPSHOT"
VERSIONX_DOTLESS+="-SNAPSHOT"
set_snapshot
fi

return 0
}

function set_snapshot {
putVar VERSION_SUFFIX "-SNAPSHOT"
putVar IS_SNAPSHOT true
BUILD_VERSION+="-SNAPSHOT"
VERSIONX_DOTLESS+="-SNAPSHOT"
}

# Checks for CIRCLECI and normalizes some ENV vars that are availiable
function circle_init_env {
CIRCLECI="${CIRCLECI:-}" # default to empty
Expand Down

0 comments on commit 801c65a

Please sign in to comment.