aboutsummaryrefslogtreecommitdiff
path: root/caronte.go
diff options
context:
space:
mode:
Diffstat (limited to 'caronte.go')
-rw-r--r--caronte.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/caronte.go b/caronte.go
index d4265bc..2d24af6 100644
--- a/caronte.go
+++ b/caronte.go
@@ -21,9 +21,10 @@ import (
"flag"
"fmt"
log "github.com/sirupsen/logrus"
- "io/ioutil"
)
+var Version string
+
func main() {
mongoHost := flag.String("mongo-host", "localhost", "address of MongoDB")
mongoPort := flag.Int("mongo-port", 27017, "port of MongoDB")
@@ -40,12 +41,10 @@ func main() {
log.WithError(err).WithFields(logFields).Fatal("failed to connect to MongoDB")
}
- versionBytes, err := ioutil.ReadFile("VERSION")
- if err != nil {
- log.WithError(err).Fatal("failed to load version file")
+ if Version == "" {
+ Version = "undefined"
}
-
- applicationContext, err := CreateApplicationContext(storage, string(versionBytes))
+ applicationContext, err := CreateApplicationContext(storage, Version)
if err != nil {
log.WithError(err).WithFields(logFields).Fatal("failed to create application context")
}