Files
SpotiFLAC/backend/folder.go
T
afkarxyz 80888ca5ad v5.5
2025-11-21 23:32:51 +07:00

24 lines
386 B
Go

package backend
import (
"os/exec"
"runtime"
)
func OpenFolderInExplorer(path string) error {
var cmd *exec.Cmd
switch runtime.GOOS {
case "windows":
cmd = exec.Command("explorer", path)
case "darwin": // macOS
cmd = exec.Command("open", path)
case "linux":
cmd = exec.Command("xdg-open", path)
default:
cmd = exec.Command("xdg-open", path)
}
return cmd.Start()
}