mirror of https://github.com/perkeep/perkeep.git
cammount: add -term flag, like -xterm but different
Change-Id: Idd81e345c4995a0ee939a2b4fe01d339f44ba526
This commit is contained in:
parent
ef1063828b
commit
63d4bafd0c
|
@ -36,6 +36,7 @@ import (
|
||||||
"camlistore.org/pkg/cacher"
|
"camlistore.org/pkg/cacher"
|
||||||
"camlistore.org/pkg/client"
|
"camlistore.org/pkg/client"
|
||||||
"camlistore.org/pkg/fs"
|
"camlistore.org/pkg/fs"
|
||||||
|
"camlistore.org/pkg/osutil"
|
||||||
"camlistore.org/pkg/search"
|
"camlistore.org/pkg/search"
|
||||||
"camlistore.org/third_party/bazil.org/fuse"
|
"camlistore.org/third_party/bazil.org/fuse"
|
||||||
fusefs "camlistore.org/third_party/bazil.org/fuse/fs"
|
fusefs "camlistore.org/third_party/bazil.org/fuse/fs"
|
||||||
|
@ -44,6 +45,7 @@ import (
|
||||||
var (
|
var (
|
||||||
debug = flag.Bool("debug", false, "print debugging messages.")
|
debug = flag.Bool("debug", false, "print debugging messages.")
|
||||||
xterm = flag.Bool("xterm", false, "Run an xterm in the mounted directory. Shut down when xterm ends.")
|
xterm = flag.Bool("xterm", false, "Run an xterm in the mounted directory. Shut down when xterm ends.")
|
||||||
|
term = flag.Bool("term", false, "Open a terminal window. Doesn't shut down when exited. Mostly for demos.")
|
||||||
open = flag.Bool("open", false, "Open a GUI window")
|
open = flag.Bool("open", false, "Open a GUI window")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -178,8 +180,16 @@ func main() {
|
||||||
}
|
}
|
||||||
if *open {
|
if *open {
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" {
|
||||||
cmd := exec.Command("open", mountPoint)
|
go exec.Command("open", mountPoint).Run()
|
||||||
go cmd.Run()
|
}
|
||||||
|
}
|
||||||
|
if *term {
|
||||||
|
if runtime.GOOS == "darwin" {
|
||||||
|
if osutil.DirExists("/Applications/iTerm.app/") {
|
||||||
|
go exec.Command("open", "-a", "iTerm", mountPoint).Run()
|
||||||
|
} else {
|
||||||
|
log.Printf("TODO: iTerm not installed. Figure out how to open with Terminal.app instead.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue