-
Notifications
You must be signed in to change notification settings - Fork 0
/
helper_cli
executable file
·73 lines (67 loc) · 1.88 KB
/
helper_cli
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python3
from rich import print
from rich.prompt import Prompt
import os
OPTIONS = [
[
"Generate JSON Files",
[
"cd data/ramayan/",
"python3 get_json.py",
],
],
[
"Watch TXT files for changes",
[
"cd data/ramayan/",
"python3 get_json.py --watch --no-log-time",
],
],
[
"Run Checks on JSON Files",
[
"cd data/ramayan/",
"python3 run_tests.py",
],
"[bold]The test report has been generated as 'data/ramayan/test_output.md'. Open that file and press `[yellow]Ctrl+Shift+V[/]` to view the report[/]",
],
["Launch the web app", ["pnpm dev"]],
[
"Update Dependencies",
[
"cd data/ramayan/",
"pip install -r requirements.txt",
"cd ../..",
"pnpm install",
],
],
# [
# "Generate JSON Files + Excel zip",
# [
# "rm -f rAmAyaNam.zip",
# "cd data/ramayan/",
# "python3 get_json.py",
# "cd ../..",
# "npx vite-node data/ramayan/make_excel_files.ts",
# "cp ./data/ramayan/zipped/rAmAyaNam.zip .",
# ],
# "[bold]The zip file has been generated as 'rAmAyaNam.zip'[/]",
# ],
]
def main():
print("[bold yellow]Select an option to run:[/]")
for i, option in enumerate(OPTIONS):
print(f"[blue]{i+1}. {option[0]}[/]")
print(f"[blue]e. Exit[/]")
CHOICES = [str(i + 1) for i in range(len(OPTIONS))]
CHOICES.append("e")
choice = Prompt.ask("Choose an option", choices=CHOICES)
if choice == "e":
return
command_info = OPTIONS[int(choice) - 1]
command = " && ".join(command_info[1])
os.system(command)
if len(command_info) == 3:
print(command_info[2])
if __name__ == "__main__":
main()