-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
27 lines (20 loc) · 738 Bytes
/
cli.py
File metadata and controls
27 lines (20 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import sys, os, json, subprocess
from argparse import ArgumentParser
from pathlib import Path
from decouple import config
__dir__ = Path(__file__).absolute().parent.parent
sys.path.append(str(__dir__ / "src"))
def shell(cmd):
"""Run bash command"""
process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
stdout = stdout.decode("utf-8")
stderr = stderr.decode("utf-8")
return stdout, stderr
def main(args):
"""Empty main function"""
return 0
if __name__ == "__main__":
argparse = ArgumentParser()
argparse.add_argument('--input', default='/', type=str, help='input dir')
sys.exit(main(argparse.parse_args()))