Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 28 lines (23 sloc) 620 Bytes
#!/bin/bash
set -o errexit
server=$1
remote_paths="$server:\""
for remote_path in "${@:2}"; do
remote_paths="$remote_paths '$remote_path'"
done
remote_paths="$remote_paths\""
if test $(find ~/.tr_timestamp -atime -5s); then
exit
fi
touch ~/.tr_timestamp
to_dir=$(mktemp -d)
cmd="rsync -av $remote_paths '$to_dir' && open '$to_dir'"
script_name=$(mktemp)
echo $cmd > $script_name
bash_cmd="/bin/bash '$script_name'"
echo "$bash_cmd" > /tmp/tr_debug
script="tell application \"iTerm2\"
create window with default profile command \"$bash_cmd\"
end tell"
echo "$script" >> /tmp/tr_debug
osascript -e "$script"
You can’t perform that action at this time.