Skip to content

Commit

Permalink
Consolidate common logic. (#1123)
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-rieke committed Jun 28, 2024
1 parent 496335c commit 76b22bf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions atrium/vestibulum/trcshbase/trcsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ func CommonMain(envPtr *string, addrPtr *string, envCtxPtr *string,
// Initiate signal handling.
var ic chan os.Signal = make(chan os.Signal, 5)

regionPtr = flagset.String("region", "", "Region to be processed") //If this is blank -> use context otherwise override context.
trcPathPtr = flagset.String("c", "", "Optional script to execute.") //If this is blank -> use context otherwise override context.

if !eUtils.IsWindows() {
if os.Geteuid() == 0 {
fmt.Println("Trcsh cannot be run as root.")
Expand All @@ -254,14 +257,10 @@ func CommonMain(envPtr *string, addrPtr *string, envCtxPtr *string,
os.Args[1] = "-c=" + os.Args[1]
}
}
regionPtr = flagset.String("region", "", "Region to be processed") //If this is blank -> use context otherwise override context.
trcPathPtr = flagset.String("c", "", "Optional script to execute.") //If this is blank -> use context otherwise override context.
projectServicePtr = flagset.String("projectService", "", "Service namespace to pull templates from if not present in LFS")
dronePtr = flagset.Bool("drone", false, "Run as drone.")
signal.Notify(ic, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP, syscall.SIGABRT)
} else {
regionPtr = flagset.String("region", "", "Region to be processed") //If this is blank -> use context otherwise override context.
trcPathPtr = flagset.String("c", "", "Optional script to execute.") //If this is blank -> use context otherwise override context.
dronePtr = new(bool)
*dronePtr = false

Expand Down

0 comments on commit 76b22bf

Please sign in to comment.