Source

hgd / hd

Full commit
#!/usr/bin/env bash

set -e

DIR="`pwd`"
CMD=""

for ARG in "$@"
do
    CMD="$CMD"$'\r\n'"$ARG"
done

PAYLOAD="$DIR"$'\r\n'"$CMD"$'\r\n'"HGDAEMONARGSDONE"$'\r\n'

echo "$PAYLOAD" | netcat localhost 8029 || { echo "abort: hgd server not running!" >&2; exit 1; }

exit