Browse Source

Merge pull request #1479 from gravitl/bugfix_v0.14.7_revert_mac_path

reverting mac path
Alex Feiszli 3 years ago
parent
commit
658bad4f81
2 changed files with 14 additions and 19 deletions
  1. 12 14
      netclient/functions/upgrades/v0-14-7.go
  2. 2 5
      netclient/ncutils/netclientutils.go

+ 12 - 14
netclient/functions/upgrades/v0-14-7.go

@@ -1,12 +1,8 @@
 package upgrades
 package upgrades
 
 
 import (
 import (
-	"os"
-	"runtime"
-
 	"github.com/gravitl/netmaker/logger"
 	"github.com/gravitl/netmaker/logger"
 	"github.com/gravitl/netmaker/netclient/config"
 	"github.com/gravitl/netmaker/netclient/config"
-	"github.com/gravitl/netmaker/netclient/ncutils"
 )
 )
 
 
 var upgrade0147 = UpgradeInfo{
 var upgrade0147 = UpgradeInfo{
@@ -26,16 +22,18 @@ var upgrade0147 = UpgradeInfo{
 func update0147(cfg *config.ClientConfig) {
 func update0147(cfg *config.ClientConfig) {
 	//do stuff for 14.X -> 14.6
 	//do stuff for 14.X -> 14.6
 	// No-op
 	// No-op
-	if runtime.GOARCH == "darwin" {
-		oldLocation := "/Applications/Netclient"
-		newLocation := ncutils.MAC_APP_DATA_PATH
-		err := os.Rename(oldLocation, newLocation)
-		if err != nil {
-			logger.FatalLog("There was an issue moving the Netclient file from Applications to Application Support:", err.Error())
-		} else {
-			logger.Log(0, "The Netclient data file has been moved from Applications to Application Support")
-		}
+	/*
+		if runtime.GOARCH == "darwin" {
+			oldLocation := "/Applications/Netclient"
+			newLocation := ncutils.MAC_APP_DATA_PATH
+			err := os.Rename(oldLocation, newLocation)
+			if err != nil {
+				logger.FatalLog("There was an issue moving the Netclient file from Applications to Application Support:", err.Error())
+			} else {
+				logger.Log(0, "The Netclient data file has been moved from Applications to Application Support")
+			}
 
 
-	}
+		}
+	*/
 	logger.Log(0, "updating schema for v0.14.7")
 	logger.Log(0, "updating schema for v0.14.7")
 }
 }

+ 2 - 5
netclient/ncutils/netclientutils.go

@@ -42,15 +42,12 @@ const NO_DB_RECORDS = "could not find any records"
 // LINUX_APP_DATA_PATH - linux path
 // LINUX_APP_DATA_PATH - linux path
 const LINUX_APP_DATA_PATH = "/etc/netclient"
 const LINUX_APP_DATA_PATH = "/etc/netclient"
 
 
-// MAC_APP_DATA_PATH - linux path
-const MAC_APP_DATA_PATH = "/Library/Application Support/Netclient"
+// MAC_APP_DATA_PATH - mac path
+const MAC_APP_DATA_PATH = "/Applications/Netclient"
 
 
 // WINDOWS_APP_DATA_PATH - windows path
 // WINDOWS_APP_DATA_PATH - windows path
 const WINDOWS_APP_DATA_PATH = "C:\\Program Files (x86)\\Netclient"
 const WINDOWS_APP_DATA_PATH = "C:\\Program Files (x86)\\Netclient"
 
 
-// WINDOWS_APP_DATA_PATH - windows path
-//const WINDOWS_WG_DPAPI_PATH = "C:\\Program Files\\WireGuard\\Data\\Configurations"
-
 // WINDOWS_SVC_NAME - service name
 // WINDOWS_SVC_NAME - service name
 const WINDOWS_SVC_NAME = "netclient"
 const WINDOWS_SVC_NAME = "netclient"