2014-05-24 15:38:41 +02:00
|
|
|
#!/usr/bin/env expect
|
|
|
|
|
|
|
|
|
|
# disables script output
|
|
|
|
|
log_user 0
|
|
|
|
|
|
|
|
|
|
spawn tmux
|
|
|
|
|
|
|
|
|
|
# Waiting for tmux to attach. If this is not done, next command, `send` will
|
|
|
|
|
# not work properly.
|
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
|
|
# this is tmux prefix + I
|
|
|
|
|
send "I"
|
|
|
|
|
|
|
|
|
|
# cloning might take a while
|
|
|
|
|
set timeout 15
|
|
|
|
|
|
|
|
|
|
expect {
|
2014-08-05 21:13:43 +02:00
|
|
|
"Installing \"tmux-example-plugin\"" {
|
2014-05-24 15:38:41 +02:00
|
|
|
|
|
|
|
|
expect {
|
2014-08-05 21:13:43 +02:00
|
|
|
"\"tmux-example-plugin\" download success" {
|
2014-05-24 15:38:41 +02:00
|
|
|
|
2014-08-05 21:23:37 +02:00
|
|
|
expect { "Done, press ENTER to continue" {
|
|
|
|
|
send "
|
|
|
|
|
"
|
|
|
|
|
}
|
2014-05-24 15:38:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 21:23:37 +02:00
|
|
|
timeout {
|
|
|
|
|
puts "Plugin installation timeout (1)";
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# this is tmux prefix + I
|
|
|
|
|
send "I"
|
|
|
|
|
|
|
|
|
|
expect {
|
|
|
|
|
"Already installed \"tmux-example-plugin\"" {
|
|
|
|
|
|
|
|
|
|
expect { "Done, press ENTER to continue" { exit 0 } }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
timeout {
|
2014-05-24 15:38:41 +02:00
|
|
|
puts "Plugin installation timeout (2)";
|
|
|
|
|
exit 1
|
|
|
|
|
}
|