Skip to content

Commit b06abdf

Browse files
tomgrvCopilot
andcommitted
fix: 🐛 handle legitimate naming
Co-authored-by: Copilot <[email protected]>
1 parent e8e0f28 commit b06abdf

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/githooks/_post-checkout.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,5 @@ if test "$GIT_COMMAND" = "rebase"; then
2222
exit 0
2323
fi
2424

25-
# Update VERSION file with current GitVersion semver
26-
if [ -f "./update-version.sh" ]; then
27-
./update-version.sh || zz_log w "Failed to update VERSION file"
28-
else
29-
zz_log w "update-version.sh script not found, skipping VERSION file update"
30-
fi
25+
# Update VERSION file with current GitVersion semver using update-version script in the git hooks directory
26+
git hook run update-version || zz_log w "Failed to update VERSION file"

update-version.sh renamed to src/githooks/_update-version.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ update_version_file() {
1212
local version="$1"
1313
if [ -n "$version" ]; then
1414
echo "$version" > "$VERSION_FILE"
15-
echo "Updated VERSION file to: $version"
15+
zz_log s "Updated VERSION file to: $version"
1616
else
17-
echo "Warning: Could not determine version"
17+
zz_log w "Could not determine version"
1818
fi
1919
}
2020

@@ -34,7 +34,7 @@ if command -v dotnet-gitversion >/dev/null 2>&1; then
3434
# Try to get MajorMinorPatch from GitVersion
3535
GITVERSION_OUTPUT=$(dotnet-gitversion -config .gitversion -showvariable MajorMinorPatch 2>/dev/null || echo "")
3636
# Check if output is a valid version number (only digits and dots) and not default
37-
if [ -n "$GITVERSION_OUTPUT" ] && echo "$GITVERSION_OUTPUT" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$' && [ "$GITVERSION_OUTPUT" != "1.0.0" ]; then
37+
if [ -n "$GITVERSION_OUTPUT" ] && echo "$GITVERSION_OUTPUT" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
3838
update_version_file "$GITVERSION_OUTPUT"
3939
exit 0
4040
fi
@@ -50,7 +50,7 @@ fi
5050

5151
# Final fallback - keep existing version or use default
5252
if [ -f "$VERSION_FILE" ]; then
53-
echo "Warning: Could not determine new version, keeping existing VERSION file"
53+
zz_log w "Could not determine new version, keeping existing VERSION file"
5454
else
5555
update_version_file "1.0.0"
5656
fi

0 commit comments

Comments
 (0)