Skip to content

Commit

Permalink
must make directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Akins committed Mar 2, 2017
1 parent 7d448cb commit 7ed3c89
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "")
}
Expand Down

0 comments on commit 7ed3c89

Please sign in to comment.