Skip to content

Commit

Permalink
CouncilDataProject#145: adding pre_gen_project hook to validate input…
Browse files Browse the repository at this point in the history
… variable infrastructure_slug
  • Loading branch information
gregoryfoster committed Nov 30, 2023
1 parent 74f3338 commit 15bf108
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

# Validate the specified Google Cloud Project name is <= 30 chars
infrastructure_slug = '{{ cookiecutter.infrastructure_slug }}'

if len(infrastructure_slug) > 30:
print(f"ERROR: {infrastructure_slug} is not a valid Google Cloud Project name! (>30 characters)")
sys.exit(1)

0 comments on commit 15bf108

Please sign in to comment.