File tree Expand file tree Collapse file tree 4 files changed +54
-15
lines changed Expand file tree Collapse file tree 4 files changed +54
-15
lines changed Original file line number Diff line number Diff line change @@ -7,21 +7,18 @@ bundle = ./public/build/bundle.js
77webpack = ./node_modules/.bin/webpack
88
99
10- dev_dependencies :
11- @./tools/install_deps.py requirements.dev.txt
12-
1310dependencies :
14- @./tools/install_deps.py requirements.txt
15- @./tools/check_js_deps.sh
11+ @./tools/silent_monitor.py ./tools/ install_deps.py requirements.txt
12+ @./tools/silent_monitor.py ./tools/ check_js_deps.sh
1613
1714db_init :
18- ./tools/db_create.sh
15+ @./tools/silent_monitor.py ./tools/db_create.sh
1916
2017db_drop :
21- PYTHONPATH=. ./tools/db_drop.py
18+ @ PYTHONPATH=. ./tools/silent_monitor.py ./tools/db_drop.py
2219
2320db_test_data :
24- PYTHONPATH=. python ./cesium_app/models.py
21+ @ PYTHONPATH=. python ./cesium_app/models.py
2522
2623$(bundle ) : webpack.config.js package.json
2724 $(webpack )
@@ -32,9 +29,9 @@ bundle-watch:
3229 $(webpack ) -w
3330
3431paths :
35- mkdir -p log run tmp
36- mkdir -p log/sv_child
37- mkdir -p ~ /.local/cesium/logs
32+ @ mkdir -p log run tmp
33+ @ mkdir -p log/sv_child
34+ @ mkdir -p ~ /.local/cesium/logs
3835
3936log : paths
4037 ./tools/watch_logs.py
@@ -68,5 +65,5 @@ docker-images:
6865
6966# Call this target to see which Javascript dependencies are not up to date
7067check-js-updates :
71- @ ./tools/check_js_updates.sh
68+ ./tools/check_js_updates.sh
7269
Original file line number Diff line number Diff line change 55CHECKER=' ./node_modules/.bin/check-dependencies'
66
77if [[ ! -x ${CHECKER} ]]; then
8- npm install check-dependencies > /dev/null 2>&1
8+ npm install check-dependencies
99fi
1010
1111# We suppress output for the next command because, annoyingly, it reports
1212# that a dependency is unsatisfied even if the --install flag is specified,
1313# and that package has been successfully installed
14- ${CHECKER} --install > /dev/null 2>&1
14+ ${CHECKER} --install
1515
1616# Print report, if any unsatisfied dependencies remain
1717if ${CHECKER} ; then
1818 echo " ✓ All Javascript dependencies satisfied."
1919fi
20+
Original file line number Diff line number Diff line change 2525 if '-e' in dep :
2626 dep = dep .split ('#egg=' )[- 1 ] # use the egg name
2727 else :
28- dep = re .split ('\W +' , dep )[0 ] # discard version info
28+ dep = re .split ('[^\w\-] +' , dep )[0 ] # discard version info
2929
3030 try :
3131 __import__ (pkg_import .get (dep , dep ))
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ import subprocess
4+ import sys
5+ import shlex
6+
7+ if len (sys .argv ) < 2 :
8+ print ('Usage: silent_monitor.py <cmd to execute>' )
9+ sys .exit ()
10+
11+ cmd = ' ' .join (sys .argv [1 :])
12+
13+ tag = 'Silently executing: {}' .format (cmd )
14+ print ('[·] {}' .format (tag ), end = '' )
15+ sys .stdout .flush ()
16+
17+ p = subprocess .Popen (shlex .split (cmd ),
18+ stdout = subprocess .PIPE , stderr = subprocess .PIPE )
19+
20+ err = p .wait ()
21+ stdout , stderr = p .stderr .read ().strip (), p .stdout .read ().strip ()
22+
23+ if err == 0 :
24+ print ('\r [✓] {}' .format (tag ))
25+ else :
26+ print ('\r [✗] {}' .format (tag ))
27+ print ('\n ! Failure (exit code {}).' .format (err , cmd ))
28+
29+ if stdout :
30+ print ('--- stdout ---' )
31+ print (stdout .decode ('utf-8' ))
32+
33+ if stderr :
34+ print ('--- stderr ---' )
35+ print (stderr .decode ('utf-8' ))
36+
37+ if stdout or stderr :
38+ print ('--- end ---' )
39+
40+ sys .exit (err )
41+
You can’t perform that action at this time.
0 commit comments