internal: move shim and init into app
This structure makes more sense, as both processes are part of an app's lifecycle. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
18
internal/app/init/early.go
Normal file
18
internal/app/init/early.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package init0
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"git.gensokyo.uk/security/fortify/internal/fmsg"
|
||||
)
|
||||
|
||||
// used by the parent process
|
||||
|
||||
// TryArgv0 calls [Main] if argv0 indicates the process is started from a file named "init".
|
||||
func TryArgv0() {
|
||||
if len(os.Args) > 0 && path.Base(os.Args[0]) == "init" {
|
||||
Main()
|
||||
fmsg.Exit(0)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user