MCPcopy
hub / github.com/puma/puma-dev / main

Function main

cmd/puma-dev/main_darwin.go:47–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45)
46
47func main() {
48 flag.Parse()
49
50 allCheck()
51
52 if *fPow {
53 *fDomains = "dev"
54 *fDir = "~/.pow"
55 }
56
57 domains := strings.Split(*fDomains, ":")
58 sort.Sort(ByDecreasingTLDComplexity(domains))
59
60 if *fCleanup {
61 dev.Cleanup()
62 return
63 }
64
65 if *fUninstall {
66 onlyDeleteNowUntrustedCertAndKeyInProductionPathFunc := dev.Uninstall(LaunchAgentDirPath, domains)
67 // FIXME: As part of running tests interactively on macOS, we can't delete .cert/.key
68 // generated as part of test runs. But, we don't want to leave untrusted .cert/.key's
69 // hanging around post-uninstall. So, we delete them as part of the main codepath but
70 // ignore this returned func during testing. Eventually, when the cert/key can be
71 // stored in the macOS keychain, we can rely on that to avoid this.
72 onlyDeleteNowUntrustedCertAndKeyInProductionPathFunc()
73 return
74 }
75
76 if *fInstall {
77 err := dev.InstallIntoSystem(&dev.InstallIntoSystemArgs{
78 ApplinkDirPath: *fDir,
79 Domains: *fDomains,
80 LaunchAgentDirPath: LaunchAgentDirPath,
81 ListenPort: *fInstallPort,
82 LogfilePath: LogFilePath,
83 Timeout: (*fTimeout).String(),
84 TlsPort: *fInstallTLS,
85 NoServePublicPaths: *fNoServePublicPaths,
86 })
87
88 if err != nil {
89 log.Fatalf("Unable to install into system: %s", err)
90 }
91 return
92 }
93
94 if *fSetup {
95 err := dev.Setup()
96 if err != nil {
97 log.Fatalf("Unable to configure OS X resolver: %s", err)
98 }
99 return
100 }
101
102 if *fStop {
103 err := dev.Stop()
104 if err != nil {

Callers

nothing calls this directly

Calls 15

PurgeMethod · 0.95
ServeMethod · 0.95
SetupMethod · 0.95
ServeTLSMethod · 0.95
ServeMethod · 0.95
CleanupFunction · 0.92
UninstallFunction · 0.92
InstallIntoSystemFunction · 0.92
SetupFunction · 0.92
StopFunction · 0.92
ExpandFunction · 0.92
ConfigureResolverFunction · 0.92

Tested by

no test coverage detected