mirror of
https://github.com/tnb-labs/panel.git
synced 2026-09-01 14:55:12 +08:00
ea22c2f0a7
Replace the samber/do runtime container with explicit constructor dependencies and generated Wire graphs for ace and cli. Keep CLI application loading isolated and verify generated files in CI.
33 lines
402 B
Go
33 lines
402 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
_ "time/tzdata"
|
|
|
|
"github.com/gookit/color"
|
|
)
|
|
|
|
func main() {
|
|
if err := run(); err != nil {
|
|
color.Errorf("|-%v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
|
|
func run() error {
|
|
if os.Geteuid() != 0 {
|
|
return errors.New("panel must run as root")
|
|
}
|
|
|
|
cli, cleanup, err := initCli()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if cleanup != nil {
|
|
defer cleanup()
|
|
}
|
|
|
|
return cli.Run()
|
|
}
|