-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal_setup.py
More file actions
executable file
·38 lines (29 loc) · 978 Bytes
/
local_setup.py
File metadata and controls
executable file
·38 lines (29 loc) · 978 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
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
import subprocess
import sys
import key_setup
import os
def ensure_executed_from_repo_root():
if not key_setup.ensure_repo_root():
print("Please run this script from the repository root directory.")
sys.exit(1)
def install_precommit_hooks() -> None:
subprocess.run(["Pre-commit", "install"], check=True)
print("Pre-commit hook (re)installed.")
def install_node_dependencies():
original_dir = os.getcwd()
os.chdir(os.path.join(original_dir, "ui"))
try:
subprocess.run(["pnpm", "install"], check=True)
print("Node dependencies installed.")
finally:
# Return to the original directory
os.chdir(original_dir)
def main() -> None:
ensure_executed_from_repo_root()
install_node_dependencies()
install_precommit_hooks()
key_setup.generate_rsa_key_pair_for_local_dev()
print("Local development configuration completed!")
if __name__ == "__main__":
main()