From 7ed3c8944e480283e6a7f7ceafda7e2d02aeb430 Mon Sep 17 00:00:00 2001 From: Brian Akins Date: Thu, 2 Mar 2017 11:59:07 -0500 Subject: [PATCH] must make directory --- main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 3c92bf3..aaccf7c 100644 --- a/main.go +++ b/main.go @@ -154,9 +154,13 @@ func doMount(args []string) { r.emit(0, "") } + if err := os.MkdirAll(mountpoint, 0755); err != nil { + r.emit(-3, fmt.Sprintf("failed to create mount point: %v", err)) + } + cmd := exec.Command("mount", "-o", "bind", ds.Mountpoint, mountpoint) - if _, err := cmd.Output(); err != nil { - r.emit(-3, fmt.Sprintf("failed to mount dataset: %v", err)) + if out, err := cmd.CombinedOutput(); err != nil { + r.emit(-3, fmt.Sprintf("failed to mount dataset: %v: %s", err, string(out))) } r.emit(0, "") }