mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 03:03:27 +00:00
main: use ToSlash() to specify pkgName
This change allows windows users to specify the package with backslash as a path separator
This commit is contained in:
@@ -873,7 +873,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
pkgName := "."
|
pkgName := "."
|
||||||
if flag.NArg() == 1 {
|
if flag.NArg() == 1 {
|
||||||
pkgName = flag.Arg(0)
|
pkgName = filepath.ToSlash(flag.Arg(0))
|
||||||
} else if flag.NArg() > 1 {
|
} else if flag.NArg() > 1 {
|
||||||
fmt.Fprintln(os.Stderr, "build only accepts a single positional argument: package name, but multiple were specified")
|
fmt.Fprintln(os.Stderr, "build only accepts a single positional argument: package name, but multiple were specified")
|
||||||
usage()
|
usage()
|
||||||
@@ -919,8 +919,9 @@ func main() {
|
|||||||
usage()
|
usage()
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
pkgName := filepath.ToSlash(flag.Arg(0))
|
||||||
if command == "flash" {
|
if command == "flash" {
|
||||||
err := Flash(flag.Arg(0), *port, options)
|
err := Flash(pkgName, *port, options)
|
||||||
handleCompilerError(err)
|
handleCompilerError(err)
|
||||||
} else {
|
} else {
|
||||||
if !options.Debug {
|
if !options.Debug {
|
||||||
@@ -928,7 +929,7 @@ func main() {
|
|||||||
usage()
|
usage()
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
err := FlashGDB(flag.Arg(0), *ocdOutput, options)
|
err := FlashGDB(pkgName, *ocdOutput, options)
|
||||||
handleCompilerError(err)
|
handleCompilerError(err)
|
||||||
}
|
}
|
||||||
case "run":
|
case "run":
|
||||||
@@ -937,12 +938,13 @@ func main() {
|
|||||||
usage()
|
usage()
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
err := Run(flag.Arg(0), options)
|
pkgName := filepath.ToSlash(flag.Arg(0))
|
||||||
|
err := Run(pkgName, options)
|
||||||
handleCompilerError(err)
|
handleCompilerError(err)
|
||||||
case "test":
|
case "test":
|
||||||
pkgName := "."
|
pkgName := "."
|
||||||
if flag.NArg() == 1 {
|
if flag.NArg() == 1 {
|
||||||
pkgName = flag.Arg(0)
|
pkgName = filepath.ToSlash(flag.Arg(0))
|
||||||
} else if flag.NArg() > 1 {
|
} else if flag.NArg() > 1 {
|
||||||
fmt.Fprintln(os.Stderr, "test only accepts a single positional argument: package name, but multiple were specified")
|
fmt.Fprintln(os.Stderr, "test only accepts a single positional argument: package name, but multiple were specified")
|
||||||
usage()
|
usage()
|
||||||
|
|||||||
Reference in New Issue
Block a user