From d52bdd3356137cf67a3458fdee5c94fdec4337e1 Mon Sep 17 00:00:00 2001 From: "marius a. eriksen" Date: Tue, 23 Dec 2014 20:45:35 -0800 Subject: devdraw: plumb drag-n-dropped files Change-Id: I7585870aee57c7482ebdd19c117be7982123ce79 Reviewed-on: https://plan9port-review.googlesource.com/1130 Reviewed-by: Russ Cox --- bin/macedit | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/macedit (limited to 'bin/macedit') 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 -- cgit v1.2.3