aboutsummaryrefslogtreecommitdiff
path: root/cmd/planr/sub/common.go
blob: ec673566f4fb2bebb3c086c2e90fd46a57d278e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package sub

import (
  "golang.furkistan.com/planr"
  "os"
  "fmt"
)

func dieIncompatibleVersion(cfg *planr.Config) {
  if cfg != nil && cfg.IncompatibleWithVersion() {
    fmt.Fprintf(os.Stderr, "This version of PlanR (%v) is incompatible with config version %s\n", planr.VERSION, cfg.Version)
    fmt.Fprintf(os.Stderr, "Please upgrade to version %s or greater\n", cfg.Version)
    os.Exit(1)
  }
}