simplify entrypoint logix
Jes Olson j3s@c3f.net
Wed, 28 Sep 2022 02:13:27 -0500
1 files changed,
2 insertions(+),
5 deletions(-)
jump to
M
main.go
→
main.go
@@ -14,7 +14,6 @@
func main() { // git vars var branch string - var entryPointDir string if os.Geteuid() != 0 { fmt.Println("! you are running zoa as a non-root user. not ideal tbh. !") }@@ -29,7 +28,7 @@ path := os.Args[1]
gitMode := git.GitMode(path) if gitMode { - utils.SetZoaRoot("/var/lib/zoa") + utils.SetZoaRoot("/var/lib/zoa/repo") err := os.MkdirAll(utils.ZoaRoot, 0755) if err != nil { log.Fatal(err)@@ -37,16 +36,14 @@ }
// check the path & branch, make sure it's correct // then clone git.Clone(path, branch) - entryPointDir = filepath.Join(utils.ZoaRoot, "repo") } else { utils.SetZoaRoot(path) - entryPointDir = utils.ZoaRoot } // TODO: this writer is responsible for the random stdout // maybe save the stdout for debug mode somehow - main := filepath.Join(entryPointDir, "main") + main := filepath.Join(utils.ZoaRoot, "main") shell.RunScript(main) }