Try it, YMMV:
#!/bin/bashpasadena = name of my Mac OS X machine
cd $(dirname $1)
PWD=`/bin/pwd`
BASENAME=$(basename $1)
ssh pasadena "osascript -e \
'tell app \"Terminal\" to do \
shell script \"/usr/local/bin/mate /Volumes/emil$PWD/$BASENAME\"'" >& /dev/null &
/Volumes/emil = sshfs mount point
Update: I removed the "-w" option (I didn't want TextMate to wait for the file to be closed) and redirected all the garbage to /dev/null.
Update 2: Support arbitrary (i.e. also absolute) paths.
Update 3: this is broken on Snow Leopard :(
Update 4: Here's a workaround, although it's a bit ugly as you need to invoke sudo.
No comments:
Post a Comment