Check for /run/media on Linux for non-debian-based distros

Этот коммит содержится в:
Arsen Musayelyan 2021-12-28 16:31:28 -08:00 коммит произвёл Ron Evans
родитель 3e109fca5f
коммит 26625f5a22

12
main.go
Просмотреть файл

@ -719,7 +719,12 @@ func flashUF2UsingMSD(volume, tmppath string, options *compileopts.Options) erro
var infoPath string
switch runtime.GOOS {
case "linux", "freebsd":
_, err := os.ReadDir("/run/media")
if err != nil {
infoPath = "/media/*/" + volume + "/INFO_UF2.TXT"
} else {
infoPath = "/run/media/*/" + volume + "/INFO_UF2.TXT"
}
case "darwin":
infoPath = "/Volumes/" + volume + "/INFO_UF2.TXT"
case "windows":
@ -743,7 +748,12 @@ func flashHexUsingMSD(volume, tmppath string, options *compileopts.Options) erro
var destPath string
switch runtime.GOOS {
case "linux", "freebsd":
destPath = "/media/*/" + volume
_, err := os.ReadDir("/run/media")
if err != nil {
infoPath = "/media/*/" + volume
} else {
infoPath = "/run/media/*/" + volume
}
case "darwin":
destPath = "/Volumes/" + volume
case "windows":