2021-03-16 19:22:06 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
2022-06-11 21:17:43 +00:00
|
|
|
_ "github.com/joho/godotenv/autoload"
|
2021-12-03 01:12:51 +00:00
|
|
|
"github.com/urfave/cli/v2"
|
2021-12-05 13:45:17 +00:00
|
|
|
|
2021-12-03 01:12:51 +00:00
|
|
|
"codeberg.org/codeberg/pages/cmd"
|
2021-03-16 19:22:06 +00:00
|
|
|
)
|
|
|
|
|
2022-03-27 19:54:06 +00:00
|
|
|
// can be changed with -X on compile
|
|
|
|
var version = "dev"
|
2021-03-16 19:22:06 +00:00
|
|
|
|
|
|
|
func main() {
|
2021-12-03 01:12:51 +00:00
|
|
|
app := cli.NewApp()
|
|
|
|
app.Name = "pages-server"
|
|
|
|
app.Version = version
|
|
|
|
app.Usage = "pages server"
|
|
|
|
app.Action = cmd.Serve
|
|
|
|
app.Flags = cmd.ServeFlags
|
|
|
|
app.Commands = []*cli.Command{
|
|
|
|
cmd.Certs,
|
2021-11-20 20:10:46 +00:00
|
|
|
}
|
2021-11-20 14:54:52 +00:00
|
|
|
|
2021-12-03 01:12:51 +00:00
|
|
|
if err := app.Run(os.Args); err != nil {
|
|
|
|
_, _ = fmt.Fprintln(os.Stderr, err)
|
|
|
|
os.Exit(1)
|
2021-03-16 19:22:06 +00:00
|
|
|
}
|
|
|
|
}
|