#!/usr/bin/env bash

set -o errexit
set -o nounset

function deployTo {
	if [ -n "${1-}" ]; then
		machine="${1}"

		rsync -ave ssh --delete \
		--files-from=$HOME/.config/deploy/files.txt \
		--exclude=.git/ \
		--dry-run \
		~/.config/ "${machine}":/home/tae/.config/
	else
		echo $"ERROR: Missing destination machine."
	fi
}

deployTo $@

#!/usr/bin/env bash

set -o errexit
set -o nounset

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
  DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
  SOURCE="$(readlink "$SOURCE")"
  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
readonly OWN_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"

function deployTo {
	if [ -n "${1-}" ]; then
		machine="${1}"

		rsync --archive --verbose --delete --rsh "ssh -p 2222" \
		--files-from="${OWN_DIR}"/files.txt \
		--exclude=.git/ \
		~/.config/ "${machine}":.config/
	else
		echo $"ERROR: Missing destination machine."
	fi
}

deployTo $@

Improve files.txt and user management
Improve files.txt and user management
