all repos — goutils @ 590634d4a3e601cb147b52008a9f42dd26029f4e

Go utilities

sshfs mount helper
Adrian Cybulski adrian@cybulski.cc
Thu, 03 Oct 2024 16:46:39 +0100
commit

590634d4a3e601cb147b52008a9f42dd26029f4e

2 files changed, 19 insertions(+), 0 deletions(-)

jump to
A go.mod

@@ -0,0 +1,3 @@

+module git.cybulski.cc/goutils + +go 1.22.2
A ssh/mount.go

@@ -0,0 +1,16 @@

+package ssh + +import "os/exec" + +// Mount SSHFS filesystem +// requires sshfs binary +func Mount(opts ...string) error { + execPath, err := exec.LookPath("sshfs") + if err != nil { + return err + } + + cmd := exec.Command(execPath, opts...) + + return cmd.Run() +}