fix windows compatability

This commit is contained in:
partisan 2024-09-10 23:09:24 +02:00
parent f497557264
commit dfbecf7f98
2 changed files with 6 additions and 2 deletions

View file

@ -20,9 +20,13 @@ func runCommand(command string, args ...string) error {
// Function to resolve paths using absolute path
func ResolvePath(path string) (string, error) {
// Convert Unix-style slashes to the platform's native slashes
path = filepath.FromSlash(path)
// Get the absolute path
absPath, err := filepath.Abs(path)
if err != nil {
return "", fmt.Errorf("failed to resolve path: %s", path)
return "", fmt.Errorf("failed to resolve path: %s, error: %v", path, err)
}
return absPath, nil
}