diff options
author | marius a. eriksen <marius.eriksen@gmail.com> | 2014-12-23 20:45:35 -0800 |
---|---|---|
committer | Russ Cox <rsc@google.com> | 2015-06-03 15:26:27 +0000 |
commit | d52bdd3356137cf67a3458fdee5c94fdec4337e1 (patch) | |
tree | 99f1d4baf8e13448992224b7995e675cd19c4b10 /bin/macedit | |
parent | 25822e8da338df2c15959bd8d347f230dc2b2d89 (diff) | |
download | plan9port-d52bdd3356137cf67a3458fdee5c94fdec4337e1.tar.gz plan9port-d52bdd3356137cf67a3458fdee5c94fdec4337e1.tar.bz2 plan9port-d52bdd3356137cf67a3458fdee5c94fdec4337e1.zip |
devdraw: plumb drag-n-dropped files
Change-Id: I7585870aee57c7482ebdd19c117be7982123ce79
Reviewed-on: https://plan9port-review.googlesource.com/1130
Reviewed-by: Russ Cox <rsc@google.com>
Diffstat (limited to 'bin/macedit')
-rwxr-xr-x | bin/macedit | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/macedit b/bin/macedit new file mode 100755 index 00000000..23a17a25 --- /dev/null +++ b/bin/macedit @@ -0,0 +1,17 @@ +#!/bin/bash + +PLAN9=${PLAN9:-/usr/local/plan9} +bin=$PLAN9/bin + +file=$1 + +# Blanks are problematic in filenames: just plumb +# the file's content. +if echo "$file" | grep -q " " +then + base=$(basename "$file" | sed 's/ /_/g') + attr="action=showdata filename=/BadName/$base" + cat $file | "$bin/plumb" -i -d edit -a "$attr" +else + "$bin/plumb" -d edit "$file" +fi |