check err just in case
This commit is contained in:
BIN
bin/nwg-drawer
BIN
bin/nwg-drawer
Binary file not shown.
6
tools.go
6
tools.go
@@ -650,8 +650,8 @@ func open(filePath string, xdgOpen bool) {
|
|||||||
cmd = exec.Command("xdg-open", filePath)
|
cmd = exec.Command("xdg-open", filePath)
|
||||||
// Look for possible custom file association
|
// Look for possible custom file association
|
||||||
for key, element := range preferredApps {
|
for key, element := range preferredApps {
|
||||||
r, _ := regexp.Compile(key)
|
r, err := regexp.Compile(key)
|
||||||
if r.MatchString(filePath) {
|
if err == nil && r.MatchString(filePath) {
|
||||||
cmd = exec.Command(fmt.Sprintf("%v", element), filePath)
|
cmd = exec.Command(fmt.Sprintf("%v", element), filePath)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -659,7 +659,7 @@ func open(filePath string, xdgOpen bool) {
|
|||||||
} else {
|
} else {
|
||||||
cmd = exec.Command(*fileManager, filePath)
|
cmd = exec.Command(*fileManager, filePath)
|
||||||
}
|
}
|
||||||
fmt.Println(cmd)
|
fmt.Printf("Executing: %s", cmd)
|
||||||
cmd.Start()
|
cmd.Start()
|
||||||
|
|
||||||
gtk.MainQuit()
|
gtk.MainQuit()
|
||||||
|
|||||||
Reference in New Issue
Block a user