File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,6 @@ build-dev: deps
144144
145145run-dev : build-dev
146146 @echo " Starting Wigo development server"
147- @trap ' kill $$WIGO_PID $$TAIL_PID 2>/dev/null; wait $$WIGO_PID $$TAIL_PID 2>/dev/null; exit' INT TERM; \
148147 mkdir -p $(BASE_DIR ) /dev; \
149148 mkdir -p $(BASE_DIR ) /dev/probes/; \
150149 if [ ! -d $( BASE_DIR) /dev/probes/60 ]; then mkdir -p $( BASE_DIR) /dev/probes/60; fi ; \
@@ -165,13 +164,17 @@ run-dev: build-dev
165164 if [ ! -e $( BASE_DIR) /dev/wigo.crt ]; then \
166165 (cd $( BASE_DIR) /dev && $( BASE_DIR) /release/current/generate_cert -ca=true -duration=87600h0m0s -host " 127.0.0.1" --rsa-bits=4096; ) \
167166 fi ; \
168- sudo $(BASE_DIR ) /release/current/wigo --config $(BASE_DIR ) /etc/wigo-dev.conf & \
167+ # Try without sudo first, use sudo only if needed
168+ $(BASE_DIR ) /release/current/wigo --config $(BASE_DIR ) /etc/wigo-dev.conf & \
169169 WIGO_PID=$$ ! ; \
170170 sleep 1; \
171- tail -f $(BASE_DIR ) /dev/wigo.log 2> /dev/null & \
172- TAIL_PID=$$ ! ; \
171+ if ! kill -0 $$ WIGO_PID 2> /dev/null; then \
172+ sudo $(BASE_DIR ) /release/current/wigo --config $(BASE_DIR ) /etc/wigo-dev.conf & \
173+ WIGO_PID=$$ ! ; \
174+ fi ; \
175+ sleep 1; \
173176 cd $(BASE_DIR ) /src/public && npm run pretty && npm run watch; \
174177 EXIT_CODE=$$? ; \
175- kill $$ WIGO_PID $$ TAIL_PID 2> /dev/null ; \
176- wait $$ WIGO_PID $$ TAIL_PID 2> /dev/null; \
177- exit $$ EXIT_CODE
178+ # Cleanup: kill process and wait for it to terminate
179+ if [ -n " $$ WIGO_PID" ] ; then kill $$ WIGO_PID 2> /dev/null; wait $$ WIGO_PID 2> /dev/null ; fi ; \
180+ exit $$ EXIT_CODE
You can’t perform that action at this time.
0 commit comments