mirror of
https://github.com/tw93/Mole.git
synced 2026-02-07 15:04:19 +00:00
Optimize test reading version
This commit is contained in:
@@ -4,6 +4,10 @@ setup_file() {
|
||||
PROJECT_ROOT="$(cd "${BATS_TEST_DIRNAME}/.." && pwd)"
|
||||
export PROJECT_ROOT
|
||||
|
||||
# Read current version from mole file (single source of truth)
|
||||
CURRENT_VERSION="$(grep '^VERSION=' "$PROJECT_ROOT/mole" | head -1 | sed 's/VERSION="\(.*\)"/\1/')"
|
||||
export CURRENT_VERSION
|
||||
|
||||
ORIGINAL_HOME="${HOME:-}"
|
||||
export ORIGINAL_HOME
|
||||
|
||||
@@ -72,7 +76,7 @@ if [[ -n "$out" ]]; then
|
||||
echo "Installer executed"
|
||||
INSTALLER
|
||||
else
|
||||
echo 'VERSION="1.7.9"'
|
||||
echo "VERSION=\"$CURRENT_VERSION\""
|
||||
fi
|
||||
SCRIPT
|
||||
chmod +x "$HOME/fake-bin/curl"
|
||||
|
||||
Reference in New Issue
Block a user