File tree Expand file tree Collapse file tree 3 files changed +22
-20
lines changed Expand file tree Collapse file tree 3 files changed +22
-20
lines changed Original file line number Diff line number Diff line change 11import os
2- import subprocess
3- from sys import exit
4- from typing import List , Optional
2+
3+ from utils .cmd import run_command
54
65__requires_git__ = True
76__requires_github__ = False
87
98
10- def run_command (command : List [str ], verbose : bool ) -> Optional [str ]:
11- try :
12- result = subprocess .run (
13- command ,
14- capture_output = True ,
15- text = True ,
16- check = True ,
17- )
18- if verbose :
19- print (result .stdout )
20- return result .stdout
21- except subprocess .CalledProcessError as e :
22- if verbose :
23- print (e .stderr )
24- exit (1 )
25-
26-
279def download (verbose : bool ):
2810 os .makedirs ("things" )
2911 os .chdir ("things" )
Original file line number Diff line number Diff line change 1+ import subprocess
2+ from sys import exit
3+ from typing import List , Optional
4+
5+
6+ def run_command (command : List [str ], verbose : bool ) -> Optional [str ]:
7+ try :
8+ result = subprocess .run (
9+ command ,
10+ capture_output = True ,
11+ text = True ,
12+ check = True ,
13+ )
14+ if verbose :
15+ print (result .stdout )
16+ return result .stdout
17+ except subprocess .CalledProcessError as e :
18+ if verbose :
19+ print (e .stderr )
20+ exit (1 )
You can’t perform that action at this time.
0 commit comments