From 1ec95f469c42cf77f3fe9c8a210e3b94d07d3722 Mon Sep 17 00:00:00 2001 From: QuantumNeuralCoder <163458725+QuantumNeuralCoder@users.noreply.github.com> Date: Mon, 2 Jun 2025 12:45:04 -0700 Subject: [PATCH] version-path-from-env --- config/config.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index ea9d51f57..12c2e21e4 100644 --- a/config/config.go +++ b/config/config.go @@ -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