问题:web项目用gulp压缩处理之后,提交到github 需要2次执行命令,想把这个流程合并
解决:expect交互式命令提交
build_push.sh, 下载:build_push.sh
#!/usr/bin/bash
gulp
rsync -avr build/* .
git add *
git ci -am 'update this repo'
echo "start push .."
expect ~/.account/github.sh
~/.account/github.sh
#!/usr/bin/expect
spawn git push origin master
expect "Username for 'https://github.com':"
#uname 和 upwd 是用户名和密码
send "uname\r"
expect "Password for 'https://uname@github.com':"
send "upwd\r"
sh build_push.sh
输出:
[17:53:59] Using gu