Skip to content

Commit 776fae6

Browse files
committed
v1.0.8
1 parent ae8c300 commit 776fae6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stools.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,22 @@ func checkErr(err error) {
4646

4747
func usage() {
4848
toolName := filepath.Base(os.Args[0])
49-
fmt.Println(fmt.Sprintf("version: 1.0.5"))
49+
fmt.Println(fmt.Sprintf("version: 1.0.8"))
5050
fmt.Println(fmt.Sprintf("Usage: %s <tool> [parameters]", toolName))
5151
fmt.Println(fmt.Sprintf(" %s rm <toolname>", toolName))
5252
fmt.Println(fmt.Sprintf(" %s add <toolpath> <description>", toolName))
5353

54-
if _, err := os.Stat("conf.yaml"); os.IsNotExist(err) {
55-
os.Exit(1)
56-
}
57-
fmt.Println("\nAvailable tools:")
58-
5954
// 读取 conf.yaml 文件
6055
file, _ := exec.LookPath(os.Args[0])
6156
filepaths, _ := filepath.Abs(file)
6257
bin := filepath.Dir(filepaths)
6358
confPath := filepath.Join(bin, "conf.yaml")
6459

60+
if _, err := os.Stat(confPath); os.IsNotExist(err) {
61+
os.Exit(1)
62+
}
63+
fmt.Println("\nAvailable tools:")
64+
6565
// 读取 YAML 文件
6666
data, err := os.ReadFile(confPath)
6767
if err != nil {

0 commit comments

Comments
 (0)