Javascript 如何确定gulp watch是否正在运行
我在后台运行服务器上的gulpJavascript 如何确定gulp watch是否正在运行,javascript,gulp,gulp-watch,Javascript,Gulp,Gulp Watch,我在后台运行服务器上的gulp gulp & 但有时它会失败。所以mi的问题是:是否有一些命令让gulp询问是否正在运行。差不多 gulp status 谢谢gulp中没有什么特别的限制运行多个进程或提醒您已经运行的gulp进程 使用常规Unix技术检查进程是否正在运行。使用像supervisord或runit这样的管理器自动重新启动进程 #the program pidof will set the variable $? to either #1 or 0 in bash dep
gulp &
但有时它会失败。所以mi的问题是:是否有一些命令让gulp询问是否正在运行。差不多
gulp status
谢谢gulp中没有什么特别的限制运行多个进程或提醒您已经运行的gulp进程 使用常规Unix技术检查进程是否正在运行。使用像supervisord或runit这样的管理器自动重新启动进程
#the program pidof will set the variable $? to either
#1 or 0 in bash depending on if it finds a process
#with that name. It will also print out all the matching
#process IDs to the command line
pidof gulp
echo $? #1 if there is no process called gulp
#0 if there is a process called gulp
if pidof gulp; then
echo 'gulp is alive';
else
echo 'we need some support over here!'
./node_modules/.bin/gulp watch &
sleep 3
fi
当它停止时,你是否试图被提醒?当自动停止时,您是否尝试重新启动它?
ps aux | grep gulp
应列出正在运行的gulp进程