Skip to content

Commit

Permalink
CERT 7972 Skip setup if .env file located (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
nivcertora authored Jan 22, 2025
1 parent 182f195 commit 97986f2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/quorum/entry_points/implementations/setup_quorum.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,18 @@ def run_setup_quorum(args: argparse.Namespace):
shutil.Error: If file copy operations fail
"""
templates_dir = Path(__file__).parent.parent.parent / "templates"
target_dir = args.working_dir.resolve()
target_dir: Path = args.working_dir.resolve()

if not target_dir.exists():
pp.pprint(f"Creating directory: {target_dir}", pp.Colors.INFO)
target_dir.mkdir(parents=True, exist_ok=True)
else:
if (target_dir / ".env").exists():
pp.pprint(
f"Quorum setup .env file already exists in {target_dir}. Skipping setup.",
pp.Colors.WARNING,
)
return

# Collect all file names to copy from the templates directory
template_files = [
Expand Down

0 comments on commit 97986f2

Please sign in to comment.