#!/usr/bin/expect
set timeout 30
set path "/root/.jenkins/workspace/php_test/backend/web/index.php"
set env_type [lindex $argv 0]
spawn /usr/local/bin/php ./init
expect "\[0-6, or \"q\" to quit\]"
send "${env_type}\r"
expect "\[yes\|no\]"
send "yes\r"
if {[ file exists $path ]} {
expect 'overwrite\?\ \[Yes\|No\|All\|Quit\]'
send "All\r"
expect eof
} else {
expect eof
}
2407

被折叠的 条评论
为什么被折叠?



