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