urbit/install.sh

32 lines
644 B
Bash
Raw Normal View History

2020-09-27 16:16:33 +03:00
#!/bin/bash
usage() { printf "Usage: $0 [-w] URBIT_PIER_DIRECTORY \n(-w: flag to watch and live copy code)\n" 1>&2; exit 1; }
if [ $# -eq 0 ]; then
usage
exit 2
fi
PIER=$1
2020-09-28 11:09:04 +03:00
EXCLUDE_FILE=ignore_files.txt
2020-09-27 16:16:33 +03:00
while getopts "w" opt; do
case ${opt} in
w) WATCH_MODE="true"
PIER=$2
;;
*) usage
;;
esac
done
if [ -z "$WATCH_MODE" ]; then
2020-11-24 22:30:41 +03:00
echo "Installed btc-agents"
rsync -r --exclude-from=$EXCLUDE_FILE * $PIER/home/
2020-09-27 16:16:33 +03:00
else
echo "Watching for changes to copy to ${PIER}..."
while [ 0 ]
do
sleep 0.8
rsync -r --exclude-from=$EXCLUDE_FILE * $PIER/home/
2020-09-27 16:16:33 +03:00
done
fi