mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-10 06:29:32 +00:00
Check for /run/media on Linux for non-debian-based distros
This commit is contained in:
committed by
Ron Evans
parent
3e109fca5f
commit
26625f5a22
@@ -719,7 +719,12 @@ func flashUF2UsingMSD(volume, tmppath string, options *compileopts.Options) erro
|
|||||||
var infoPath string
|
var infoPath string
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "linux", "freebsd":
|
case "linux", "freebsd":
|
||||||
|
_, err := os.ReadDir("/run/media")
|
||||||
|
if err != nil {
|
||||||
infoPath = "/media/*/" + volume + "/INFO_UF2.TXT"
|
infoPath = "/media/*/" + volume + "/INFO_UF2.TXT"
|
||||||
|
} else {
|
||||||
|
infoPath = "/run/media/*/" + volume + "/INFO_UF2.TXT"
|
||||||
|
}
|
||||||
case "darwin":
|
case "darwin":
|
||||||
infoPath = "/Volumes/" + volume + "/INFO_UF2.TXT"
|
infoPath = "/Volumes/" + volume + "/INFO_UF2.TXT"
|
||||||
case "windows":
|
case "windows":
|
||||||
@@ -743,7 +748,12 @@ func flashHexUsingMSD(volume, tmppath string, options *compileopts.Options) erro
|
|||||||
var destPath string
|
var destPath string
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "linux", "freebsd":
|
case "linux", "freebsd":
|
||||||
destPath = "/media/*/" + volume
|
_, err := os.ReadDir("/run/media")
|
||||||
|
if err != nil {
|
||||||
|
infoPath = "/media/*/" + volume
|
||||||
|
} else {
|
||||||
|
infoPath = "/run/media/*/" + volume
|
||||||
|
}
|
||||||
case "darwin":
|
case "darwin":
|
||||||
destPath = "/Volumes/" + volume
|
destPath = "/Volumes/" + volume
|
||||||
case "windows":
|
case "windows":
|
||||||
|
|||||||
Reference in New Issue
Block a user