Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.
Open
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
11 changes: 8 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ func init() {

// Read the VERSION file from the project root
// This approach works regardless of where the program is executed from
version, err := os.ReadFile(filepath.Join(projectRoot, "VERSION"))
path := filepath.Join(projectRoot, "VERSION")
if alt := os.Getenv("DICEDB_VERSION_PATH"); alt != "" {
path = alt
}

version, err := os.ReadFile(path)
if err != nil {
slog.Error("could not read the version file", slog.String("error", err.Error()))
os.Exit(1)
slog.Error("could not read the version file", slog.String("error", err.Error()))
os.Exit(1)
}

// Store the version string in the package-level DiceDBVersion variable
Expand Down