-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.go
28 lines (23 loc) · 785 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main
import (
"fmt"
"github.com/soulteary/nginx-formatter/internal/checker"
"github.com/soulteary/nginx-formatter/internal/cmd"
"github.com/soulteary/nginx-formatter/internal/formatter"
"github.com/soulteary/nginx-formatter/internal/server"
"github.com/soulteary/nginx-formatter/internal/updater"
"github.com/soulteary/nginx-formatter/internal/version"
)
func main() {
fmt.Printf("Nginx Formatter %s\n\n", version.Version)
src, dest, indent, char, web, port := cmd.InitArgv()
if web {
err := server.Launch(port, indent, char, formatter.Formatter)
checker.FailToRun(err)
} else {
checker.InDockerAndWorkDirIsRoot(src)
checker.InputDirExist(src)
err := updater.UpdateConfInDir(src, dest, indent, char, formatter.Formatter)
checker.FailToRun(err)
}
}