1#!/nix/var/nix/profiles/default/bin/expect -f
2
3# Set variables
4set username [lindex $argv 0]
5set password [lindex $argv 1]
6set rev [lindex $argv 2]
7set url [lindex $argv 3]
8set out [lindex $argv 4]
9set timeout -1
10
11spawn svn export -r$rev svn+ssh://$username@$url $out
12match_max 100000
13
14expect "*continue connecting*" { send -- "yes\r"; expect "*?assword:*"; send -- "$password\r" } \
15 "*?assword:*" { send -- "$password\r" }
16
17expect "*?assword:*"
18send -- "$password\r"
19
20# Send blank line
21send -- "\r"
22expect eof