~laumann/acme-git

e8f6f8273ca86f88bc305c53384871ca77c6d523 — Thomas Bracht Laumann Jespersen 2 years ago fc67ac0
Add acme.sh "editor" script
1 files changed, 22 insertions(+), 0 deletions(-)

A acme-ed.sh
A acme-ed.sh => acme-ed.sh +22 -0
@@ 0,0 1,22 @@
#!/bin/bash
set -euo pipefail

# A GIT_EDITOR for Acme

# Steps to "open file"
winid=$(9p read acme/new/ctl | awk '{ print $1 }')
echo "name $1" |9p write acme/$winid/ctl
echo "get" |9p write acme/$winid/ctl

carryon=true
while "$carryon"; do
	sleep 1
	carryon=false
	while read l; do
		owinid=$(echo "$l" |awk '{ print $1 }' )
		if [[ $winid == $owinid ]]; then
			carryon=true
			break
		fi
	done <<< $(9p read acme/index)
done