v0-14-7.go 944 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package upgrades
  2. import (
  3. "os"
  4. "runtime"
  5. "github.com/gravitl/netmaker/logger"
  6. "github.com/gravitl/netmaker/netclient/config"
  7. "github.com/gravitl/netmaker/netclient/ncutils"
  8. )
  9. var upgrade0147 = UpgradeInfo{
  10. RequiredVersions: []string{
  11. "v0.14.0",
  12. "v0.14.1",
  13. "v0.14.2",
  14. "v0.14.3",
  15. "v0.14.4",
  16. "v0.14.5",
  17. "v0.14.6",
  18. },
  19. NewVersion: "v0.14.7",
  20. OP: update0147,
  21. }
  22. func update0147(cfg *config.ClientConfig) {
  23. //do stuff for 14.X -> 14.6
  24. // No-op
  25. if runtime.GOARCH == "darwin" {
  26. oldLocation := "/Applications/Netclient"
  27. newLocation := ncutils.MAC_APP_DATA_PATH
  28. err := os.Rename(oldLocation, newLocation)
  29. if err != nil {
  30. logger.FatalLog("There was an issue moving the Netclient file from Applications to Application Support:", err.Error())
  31. } else {
  32. logger.Log(0, "The Netclient data file has been moved from Applications to Application Support")
  33. }
  34. }
  35. logger.Log(0, "updating schema for v0.14.7")
  36. }