mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-21 15:44:17 +02:00
fix: use filepath.Dir instead of path.Dir
Use the `filepath` implementation of `Dir` instead of `path`. Resolve path resolution with Windows paths containing `\\` separators.
This commit is contained in:
parent
7f810bfc9f
commit
e0d667a48c
1 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/charmbracelet/charm/ui/common"
|
||||
gap "github.com/muesli/go-app-paths"
|
||||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue