Add check for -e flag for overriding aws creds file
This commit is contained in:
parent
b7f72bb67b
commit
b11f87e709
1 changed files with 7 additions and 1 deletions
|
|
@ -37,4 +37,10 @@ def generate(args):
|
|||
print("[ERROR]: Env Variable " + secret_key_name + " not found.")
|
||||
sys.exit(1)
|
||||
with open(os.path.expanduser('~/.aws/credentials'), 'w+') as f:
|
||||
f.write(contents)
|
||||
if os.path.isfile(f.name):
|
||||
answer = input("Found aws creds file already, do you want to override? [y/n]")
|
||||
if not answer or answer[0].lower() != 'y':
|
||||
print("File not changed. This flag is for CI/CD only")
|
||||
exit(1)
|
||||
else:
|
||||
f.write(contents)
|
||||
Loading…
Add table
Reference in a new issue