Skip to content

Commit df7d049

Browse files
committed
deploy: 0dc43b2
1 parent 7ebcd0b commit df7d049

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed

hands_on/add_files.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
import os
2-
3-
from utils.cmd import run_command
2+
import subprocess
3+
from sys import exit
4+
from typing import List, Optional
45

56
__requires_git__ = True
67
__requires_github__ = False
78

89

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+
927
def download(verbose: bool):
1028
os.makedirs("things")
1129
os.chdir("things")

utils/__init__.py

Whitespace-only changes.

utils/cmd.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)