fix windows compatability

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

View file

@ -60,7 +60,7 @@ func init() {
} }
func printHelp() { func printHelp() {
fmt.Println("Usage: ./main -p=<path-to-build> -t=<target> [-c|--compress] [-v|--version=<version>] [-component=<component>] [-arch=<architecture>] [-release=<release>] [-platform=<platform>]") fmt.Println("Usage: go run . -p=<path-to-build> -t=<target> [-c|--compress] [-v|--version=<version>] [-component=<component>] [-arch=<architecture>] [-release=<release>] [-platform=<platform>]")
flag.PrintDefaults() flag.PrintDefaults()
fmt.Println("Example: go run . --upload -c --upload-path=./mozilla-central/obj-x86_64-pc-linux-gnu/dist/bin -a") fmt.Println("Example: go run . --upload -c --upload-path=./mozilla-central/obj-x86_64-pc-linux-gnu/dist/bin -a")
os.Exit(0) os.Exit(0)

View file

@ -20,9 +20,13 @@ func runCommand(command string, args ...string) error {
// Function to resolve paths using absolute path // Function to resolve paths using absolute path
func ResolvePath(path string) (string, error) { 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) absPath, err := filepath.Abs(path)
if err != nil { 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 return absPath, nil
} }