fix windows compatability
This commit is contained in:
parent
f497557264
commit
dfbecf7f98
2 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue