Skip to content

Commit 7eda75c

Browse files
committed
chore: update basic implementation
1 parent 3bd6d08 commit 7eda75c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

main.go

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
package main
22

33
import (
4+
"fmt"
5+
"log"
6+
"os"
7+
48
"github.com/soulteary/nginx-formatter/internal/formatter"
59
"github.com/soulteary/nginx-formatter/internal/updater"
10+
"github.com/soulteary/nginx-formatter/internal/version"
611
)
712

813
func main() {
9-
err := updater.UpdateConfInDir(".", formatter.Formatter)
14+
fmt.Printf("Nginx Formatter v%s\n\n", version.Version)
15+
16+
dir, err := os.Getwd()
17+
if err != nil {
18+
log.Fatal(err)
19+
}
20+
21+
err = updater.UpdateConfInDir(dir, formatter.Formatter)
1022
if err != nil {
11-
panic(err)
23+
log.Fatal(err)
1224
}
1325
}

0 commit comments

Comments
 (0)