Browse Source

updated build tag locations

0xdcarns 3 years ago
parent
commit
195bda1f12
3 changed files with 24 additions and 21 deletions
  1. 0 18
      netclient/gui/gui.go
  2. 1 3
      netclient/main.go
  3. 23 0
      netclient/main_gui.go

+ 0 - 18
netclient/gui/gui.go

@@ -1,11 +1,7 @@
-//go:build gui
-// +build gui
-
 package gui
 
 import (
 	"embed"
-	"fmt"
 	"image/color"
 
 	"fyne.io/fyne/v2"
@@ -14,7 +10,6 @@ import (
 	"fyne.io/fyne/v2/theme"
 	"fyne.io/fyne/v2/widget"
 	"github.com/gravitl/netmaker/logger"
-	"github.com/gravitl/netmaker/netclient/config"
 	"github.com/gravitl/netmaker/netclient/functions"
 	"github.com/gravitl/netmaker/netclient/gui/components"
 	"github.com/gravitl/netmaker/netclient/gui/components/views"
@@ -24,19 +19,6 @@ import (
 //go:embed nm-logo-sm.png
 var logoContent embed.FS
 
-func init() {
-	fmt.Println("got in here")
-	config.GuiActive = true
-
-	config.GuiRun = func() {
-		networks, err := ncutils.GetSystemNetworks()
-		if err != nil {
-			networks = []string{}
-		}
-		Run(networks)
-	}
-}
-
 // Run - run's the netclient GUI
 func Run(networks []string) error {
 	a := app.New()

+ 1 - 3
netclient/main.go

@@ -1,9 +1,9 @@
 //go:generate goversioninfo -icon=windowsdata/resource/netmaker.ico -manifest=netclient.exe.manifest.xml -64=true -o=netclient.syso
+// -build gui
 
 package main
 
 import (
-	"fmt"
 	"log"
 	"os"
 	"runtime/debug"
@@ -37,8 +37,6 @@ func main() {
 		ncutils.CheckWG()
 	}
 
-	fmt.Printf("%d \n %v \n", len(os.Args), config.GuiActive)
-
 	if len(os.Args) <= 1 && config.GuiActive {
 		config.GuiRun.(func())()
 	} else {

+ 23 - 0
netclient/main_gui.go

@@ -0,0 +1,23 @@
+//go:build gui
+// +build gui
+
+//go:generate goversioninfo -icon=windowsdata/resource/netmaker.ico -manifest=netclient.exe.manifest.xml -64=true -o=netclient.syso
+package main
+
+import (
+	"github.com/gravitl/netmaker/netclient/config"
+	"github.com/gravitl/netmaker/netclient/gui"
+	"github.com/gravitl/netmaker/netclient/ncutils"
+)
+
+func init() {
+	config.GuiActive = true
+
+	config.GuiRun = func() {
+		networks, err := ncutils.GetSystemNetworks()
+		if err != nil {
+			networks = []string{}
+		}
+		gui.Run(networks)
+	}
+}