File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -48,24 +48,23 @@ def quickstart():
48
48
"""Setup warnet"""
49
49
try :
50
50
# Requirements checks
51
- process = subprocess .Popen (
51
+ with subprocess .Popen (
52
52
["/bin/bash" , str (QUICK_START_PATH )],
53
53
stdout = subprocess .PIPE ,
54
54
stderr = subprocess .STDOUT ,
55
55
universal_newlines = True ,
56
56
env = dict (os .environ , TERM = "xterm-256color" ),
57
- )
58
- if process .stdout :
59
- for line in iter (process .stdout .readline , "" ):
60
- click .echo (line , nl = False )
61
- process .stdout .close ()
62
- return_code = process .wait ()
63
- if return_code != 0 :
64
- click .secho (
65
- f"Quick start script failed with return code { return_code } " , fg = "red" , bold = True
66
- )
67
- click .secho ("Install missing requirements before proceeding" , fg = "yellow" )
68
- return False
57
+ ) as process :
58
+ if process .stdout :
59
+ for line in iter (process .stdout .readline , "" ):
60
+ click .echo (line , nl = False )
61
+ return_code = process .wait ()
62
+ if return_code != 0 :
63
+ click .secho (
64
+ f"Quick start script failed with return code { return_code } " , fg = "red" , bold = True
65
+ )
66
+ click .secho ("Install missing requirements before proceeding" , fg = "yellow" )
67
+ return False
69
68
70
69
# New project setup
71
70
questions = [
You can’t perform that action at this time.
0 commit comments