git.s-ol.nu alive / d8bd6a8
rename copilot to alv-copilot s-ol 1 year, 9 months ago
4 changed file(s) with 29 addition(s) and 29 deletion(s). Raw diff Collapse all Expand all
0 #!/bin/sh
1 set -e
2
3 tmpdir=$(mktemp -d)
4 trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP
5
6 ARGS="$@"
7 FIFO=$tmpdir/fifo
8 CONF=$tmpdir/conf
9 LIBDIR=$(dirname $0)
10 LUA_PATH="$LIBDIR/?.lua;$LIBDIR/?/init.lua;$LUA_PATH"
11
12 cat > "$CONF" << 'EOF'
13 split
14 focus
15 screen -t evaltime sh -c 'tty > "$FIFO"; read done < "$FIFO"'
16 focus
17 screen -t runtime sh -c 'read tty < "$FIFO"; moon "$LIBDIR/alv/copilot.moon" $ARGS 2> "$tty"; echo "[press enter to exit]"; read prompt; echo done > "$FIFO"'
18 EOF
19
20 mkfifo "$FIFO"
21 export FIFO ARGS LIBDIR LUA_PATH
22 exec screen -mc "$CONF"
0 @echo off
1 setlocal
2 set PATH=%PATH%;%~dp0\lua\lua\bin
3 set LUA_PATH=%LUA_PATH%;%~dp0\?.lua;%~dp0\alive\?\init.lua
4 moon %~dp0\init.moon %*
5 exit /b %ERRORLEVEL%
+0
-6
bin/copilot.bat less more
0 @echo off
1 setlocal
2 set PATH=%PATH%;%~dp0\lua\lua\bin
3 set LUA_PATH=%LUA_PATH%;%~dp0\?.lua;%~dp0\alive\?\init.lua
4 moon %~dp0\init.moon %*
5 exit /b %ERRORLEVEL%
+0
-23
bin/copilot.sh less more
0 #!/bin/sh
1 set -e
2
3 tmpdir=$(mktemp -d)
4 trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP
5
6 ARGS="$@"
7 FIFO=$tmpdir/fifo
8 CONF=$tmpdir/conf
9 LIBDIR=$(dirname $0)
10 LUA_PATH="$LIBDIR/?.lua;$LIBDIR/?/init.lua;$LUA_PATH"
11
12 cat > "$CONF" << 'EOF'
13 split
14 focus
15 screen -t evaltime sh -c 'tty > "$FIFO"; read done < "$FIFO"'
16 focus
17 screen -t runtime sh -c 'read tty < "$FIFO"; moon "$LIBDIR/alv/copilot.moon" $ARGS 2> "$tty"; echo "[press enter to exit]"; read prompt; echo done > "$FIFO"'
18 EOF
19
20 mkfifo "$FIFO"
21 export FIFO ARGS LIBDIR LUA_PATH
22 exec screen -mc "$CONF"