Skip to content

Commit

Permalink
✨ fix: cflag - get app name error, path.Base not support windows
Browse files Browse the repository at this point in the history
inhere committed Oct 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 21b0dcd commit a2decab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cflag/app.go
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import (
"fmt"
"io"
"os"
"path"
"path/filepath"
"sort"

"github.com/gookit/color"
@@ -127,7 +127,8 @@ func (a *App) RunWithArgs(args []string) error {

func (a *App) init() {
if a.Name == "" {
a.Name = path.Base(os.Args[0])
// fix: path.Base not support windows
a.Name = filepath.Base(os.Args[0])
}
}

0 comments on commit a2decab

Please sign in to comment.