Skip to content

Commit

Permalink
fix: use filepath.Dir instead of path.Dir
Browse files Browse the repository at this point in the history
Use the `filepath` implementation of `Dir` instead of `path`. Resolve
path resolution with Windows paths containing `\\` separators.
  • Loading branch information
Splode authored and muesli committed Sep 16, 2022
1 parent 7f810bf commit e0d667a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"os/exec"
"path"
"path/filepath"

"github.com/charmbracelet/charm/ui/common"
gap "github.com/muesli/go-app-paths"
Expand Down Expand Up @@ -53,7 +54,7 @@ var configCmd = &cobra.Command{
if _, err := os.Stat(configFile); os.IsNotExist(err) {
// File doesn't exist yet, create all necessary directories and
// write the default config file
if err := os.MkdirAll(path.Dir(configFile), 0700); err != nil {
if err := os.MkdirAll(filepath.Dir(configFile), 0700); err != nil {
return err
}

Expand Down

0 comments on commit e0d667a

Please sign in to comment.