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
7
7
webpack = ./node_modules/.bin/webpack
8
8
9
9
10
- dev_dependencies :
11
- @./tools/install_deps.py requirements.dev.txt
12
-
13
10
dependencies :
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
16
13
17
14
db_init :
18
- ./tools/db_create.sh
15
+ @./tools/silent_monitor.py ./tools/db_create.sh
19
16
20
17
db_drop :
21
- PYTHONPATH=. ./tools/db_drop.py
18
+ @ PYTHONPATH=. ./tools/silent_monitor.py ./tools/db_drop.py
22
19
23
20
db_test_data :
24
- PYTHONPATH=. python ./cesium_app/models.py
21
+ @ PYTHONPATH=. python ./cesium_app/models.py
25
22
26
23
$(bundle ) : webpack.config.js package.json
27
24
$(webpack )
@@ -32,9 +29,9 @@ bundle-watch:
32
29
$(webpack ) -w
33
30
34
31
paths :
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
38
35
39
36
log : paths
40
37
./tools/watch_logs.py
@@ -68,5 +65,5 @@ docker-images:
68
65
69
66
# Call this target to see which Javascript dependencies are not up to date
70
67
check-js-updates :
71
- @ ./tools/check_js_updates.sh
68
+ ./tools/check_js_updates.sh
72
69
Original file line number Diff line number Diff line change 5
5
CHECKER=' ./node_modules/.bin/check-dependencies'
6
6
7
7
if [[ ! -x ${CHECKER} ]]; then
8
- npm install check-dependencies > /dev/null 2>&1
8
+ npm install check-dependencies
9
9
fi
10
10
11
11
# We suppress output for the next command because, annoyingly, it reports
12
12
# that a dependency is unsatisfied even if the --install flag is specified,
13
13
# and that package has been successfully installed
14
- ${CHECKER} --install > /dev/null 2>&1
14
+ ${CHECKER} --install
15
15
16
16
# Print report, if any unsatisfied dependencies remain
17
17
if ${CHECKER} ; then
18
18
echo " ✓ All Javascript dependencies satisfied."
19
19
fi
20
+
Original file line number Diff line number Diff line change 25
25
if '-e' in dep :
26
26
dep = dep .split ('#egg=' )[- 1 ] # use the egg name
27
27
else :
28
- dep = re .split ('\W +' , dep )[0 ] # discard version info
28
+ dep = re .split ('[^\w\-] +' , dep )[0 ] # discard version info
29
29
30
30
try :
31
31
__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