MCPcopy
hub / github.com/spicetify/cli / ShowDirectory

Function ShowDirectory

src/utils/show-dir.go:9–25  ·  view source on GitHub ↗

ShowDirectory shows directory in user's default file manager application

(dir string)

Source from the content-addressed store, hash-verified

7
8// ShowDirectory shows directory in user's default file manager application
9func ShowDirectory(dir string) error {
10 var err error
11 err = nil
12
13 if runtime.GOOS == "windows" {
14 _, err = exec.Command("explorer", dir).Output()
15 if err != nil && err.Error() == "exit status 1" {
16 err = nil
17 }
18 } else if runtime.GOOS == "linux" {
19 _, err = exec.Command("xdg-open", dir).Output()
20 } else if runtime.GOOS == "darwin" {
21 _, err = exec.Command("open", dir).Output()
22 }
23
24 return err
25}

Callers 1

ShowConfigDirectoryFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected