Skip to content

Commit

Permalink
Make constants readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Jun 28, 2023
1 parent 8b565dc commit 57b849e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
10 changes: 5 additions & 5 deletions scripts/shellUtils.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

GREEN=$'\e[1;32m'
RED=$'\e[1;31m'
BLUE=$'\e[1;34m'
TITLE=$'\e[1;4;34m'
RESET=$'\e[0m'
declare -r GREEN=$'\e[1;32m'
declare -r RED=$'\e[1;31m'
declare -r BLUE=$'\e[1;34m'
declare -r TITLE=$'\e[1;4;34m'
declare -r RESET=$'\e[0m'

function success {
echo "🎉 $GREEN$1$RESET"
Expand Down
22 changes: 12 additions & 10 deletions tests/unit/CIGitLogicTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@
# Fail immediately if there is an error thrown
set -e

TEST_DIR=$(dirname "$(dirname "$(cd "$(dirname "$0")" || exit 1; pwd)/$(basename "$0")")")
SCRIPTS_DIR="$TEST_DIR/../scripts"
DUMMY_DIR="$HOME/DumDumRepo"
REPO_URL="https://github.com/roryabraham/DumDumRepo"
bumpVersion="$TEST_DIR/utils/bumpVersion.mjs"
getPullRequestsMergedBetween="$TEST_DIR/utils/getPullRequestsMergedBetween.mjs"
INITIAL_COMMIT_HASH="6a473fcb1a7792e503ca3f2a5873fcb7b9c607f3"
SEMVER_LEVEL_BUILD='BUILD'
SEMVER_LEVEL_PATCH='PATCH'
declare -r TEST_DIR=$(dirname "$(dirname "$(cd "$(dirname "$0")" || exit 1; pwd)/$(basename "$0")")")
declare -r SCRIPTS_DIR="$TEST_DIR/../scripts"
declare -r DUMMY_DIR="$HOME/DumDumRepo"
declare -r REPO_SLUG="roryabraham/DumDumRepo"
declare -r REPO_URL="https://github.com/$REPO_SLUG"
declare -r INITIAL_COMMIT_HASH="6a473fcb1a7792e503ca3f2a5873fcb7b9c607f3"
declare -r SEMVER_LEVEL_BUILD='BUILD'
declare -r SEMVER_LEVEL_PATCH='PATCH'

declare -r bumpVersion="$TEST_DIR/utils/bumpVersion.mjs"
declare -r getPullRequestsMergedBetween="$TEST_DIR/utils/getPullRequestsMergedBetween.mjs"

source "$SCRIPTS_DIR/shellUtils.sh"

function setup_git_authorization {
if [[ -n "$(git remote -v)" ]]; then
git remote remove origin
fi
git remote add origin "https://$GITHUB_TOKEN@github.com/roryabraham/DumDumRepo"
git remote add origin "https://$GITHUB_TOKEN@github.com/$REPO_SLUG"
}

function setup_git_as_human {
Expand Down

0 comments on commit 57b849e

Please sign in to comment.