Skip to content

Commit

Permalink
Update setup_env_stubs function and add print statement
Browse files Browse the repository at this point in the history
  • Loading branch information
palladius committed Mar 8, 2024
1 parent 84dd976 commit 25f8af2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bin/auto_import_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ def setup_env_stubs(config_name, env_properties):
* env_properties: eg {}
'''
print(f"config_name: {config_name}")
print(f"env_properties: {env_properties}")
#print(f"config_name: {config_name}")
#print(f"env_properties: {env_properties}")
banner = f"\n{Separator}\n# Generated by {ProgName} v{ProgVersion} on {Now}\n# Do NOT edit or it might get overwritten. Please edit the .gcloudconfig.yaml (and if needed relaunch the script)!\n{Separator}\n\n"
config = env_properties

Expand Down Expand Up @@ -182,6 +182,8 @@ def expand_vars(value):
for key, value in config.items():
f.write(f'ENV["{key}"] = "{os.path.expandvars(value)}"\n')

print("🍉 Wow, what a ride! I've just dumped your special envs into 3 sh/py/rb stubs!")


def inject_all_configs(config_data):
'Given a hash from YAML it creates one gcloud config per key'
Expand All @@ -196,8 +198,9 @@ def inject_all_configs(config_data):
continue
print(f"➕ Config '{config_name}' NOT found: creating")

# Create configuration if it doesn't exist===
execute(f"gcloud config configurations create {config_name}")
# Create configuration if it doesn't exist
# If it exists ignoring error
execute(f"gcloud config configurations create {config_name} 2>/dev/null")

opinionated_properties = {}

Expand Down

0 comments on commit 25f8af2

Please sign in to comment.