以r
項目爲例,遠程地址爲new/dest
目錄
#Source files r/
#Remove prefix r
#Remote directory new/dest/r
#Exec command
cd /new
gulp dev
gulp_pid=`ps -ef | grep 'gulp' | grep -v grep |awk '{print $2}'`
echo $gulp_pid
[ -n "$gulp_pid" ] && kill -9 $gulp_pid
nohup gulp watch > /dev/null 2>&1 &