Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/entire/cli/versioncheck/versioncheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ func isOutdated(current, latest string) bool {
latest = "v" + latest
}

// Skip notification for dev builds (e.g., "1.0.0-dev-xxx").
// These are local development builds and shouldn't trigger update notifications.
// Normal prereleases (e.g., "1.0.0-rc1") should still be compared normally.
if strings.Contains(semver.Prerelease(current), "dev") {
return false
}

// semver.Compare returns -1 if current < latest
return semver.Compare(current, latest) < 0
}
Expand Down
1 change: 1 addition & 0 deletions cmd/entire/cli/versioncheck/versioncheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func TestIsOutdated(t *testing.T) {
// Pre-release versions (semver uses hyphen)
{"1.0.0-rc1", "1.0.0", true, "prerelease in current"},
{"1.0.0", "1.0.1-rc1", true, "prerelease in latest is still newer"},
{"1.0.0-dev-xxx", "1.0.1", false, "dev build skips version check"},
}

for _, tt := range tests {
Expand Down
4 changes: 3 additions & 1 deletion mise-tasks/build
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh
#MISE description="Build the CLI"

VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "dev")
TAG=$(git describe --tags --abbrev=0 || echo "v0.0.0")
COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
VERSION="${TAG}-dev-${COMMIT}"

go build -ldflags "-X github.com/entireio/cli/cmd/entire/cli/versioninfo.Version=${VERSION} -X github.com/entireio/cli/cmd/entire/cli/versioninfo.Commit=${COMMIT}" -o entire ./cmd/entire
3 changes: 2 additions & 1 deletion mise-tasks/dev/publish
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ set -eu
export GOBIN=${GOPATH:-$HOME/go}/bin
echo "NOTE: we're overriding \$GOBIN: $GOBIN" 1>&2

VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "dev")
TAG=$(git describe --tags --abbrev=0 || echo "v0.0.0")
COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
VERSION="${TAG}-dev-${COMMIT}"

go install -ldflags "-X github.com/entireio/cli/cmd/entire/cli/versioninfo.Version=${VERSION} -X github.com/entireio/cli/cmd/entire/cli/versioninfo.Commit=${COMMIT}" ./cmd/entire
5 changes: 0 additions & 5 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,3 @@ run = "go test -tags=integration ./cmd/entire/cli/integration_test/..."
[tasks."test:ci"]
description = "Run all tests (unit + integration) with race detection"
run = "go test -tags=integration -race ./..."

[tasks."build:all"]
description = "Build for all platforms using goreleaser"
run = "goreleaser build --snapshot --clean"