Skip to content

Commit

Permalink
#145: bug_and_feature/pre_gen_project_hook - adding hook script to va…
Browse files Browse the repository at this point in the history
…lidate infrastructure_slug (#150)

#145: adding pre_gen_project hook to validate input variable infrastructure_slug
  • Loading branch information
gregoryfoster authored Dec 2, 2023
1 parent 74f3338 commit 9ca2a21
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 9ca2a21

Please sign in to comment.