Skip to content

Commit 7ebcd0b

Browse files
committed
deploy: 8e619a5
1 parent 3214c95 commit 7ebcd0b

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

hands_on/add_files.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,11 @@
11
import 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-
279
def download(verbose: bool):
2810
os.makedirs("things")
2911
os.chdir("things")

utils/__init__.py

Whitespace-only changes.

utils/cmd.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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)

0 commit comments

Comments
 (0)