Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CERT 7972 Skip setup if .env file located #78

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading