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
|
|
|
|
|
|
2015-08-02 22:46:57 +02:00
|
|
|
expect_after {
|
|
|
|
|
timeout { exit 1 }
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-24 15:38:41 +02:00
|
|
|
expect {
|
2015-08-02 22:46:57 +02:00
|
|
|
"Installing \"tmux-example-plugin\""
|
|
|
|
|
}
|
2014-05-24 15:38:41 +02:00
|
|
|
|
2015-08-02 22:46:57 +02:00
|
|
|
expect {
|
|
|
|
|
"\"tmux-example-plugin\" download success"
|
|
|
|
|
}
|
2014-05-24 15:38:41 +02:00
|
|
|
|
2015-08-02 22:46:57 +02:00
|
|
|
expect {
|
|
|
|
|
"Done, press ENTER to continue" {
|
|
|
|
|
send "
|
2014-08-05 21:23:37 +02:00
|
|
|
"
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-08-02 22:46:57 +02:00
|
|
|
|
2014-08-05 21:23:37 +02:00
|
|
|
sleep 1
|
|
|
|
|
# this is tmux prefix + I
|
|
|
|
|
send "I"
|
|
|
|
|
|
2015-08-02 22:46:57 +02:00
|
|
|
expect {
|
|
|
|
|
"Already installed \"tmux-example-plugin\""
|
2014-08-05 21:23:37 +02:00
|
|
|
}
|
2015-08-02 22:46:57 +02:00
|
|
|
|
|
|
|
|
expect {
|
|
|
|
|
"Done, press ENTER to continue" {
|
2014-05-24 15:38:41 +02:00
|
|
|
exit 0
|
|
|
|
|
}
|
2015-08-02 22:46:57 +02:00
|
|
|
}
|
|
|
|
|
|