Skip to content
Open
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
5 changes: 4 additions & 1 deletion awsmfa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

logger = logging.getLogger('aws-mfa')

AWS_CREDS_PATH = '%s/.aws/credentials' % (os.path.expanduser('~'),)
AWS_USER_PATH_DIR = f'{os.path.expanduser("~")}/.aws'
AWS_CREDS_PATH = f'{AWS_USER_PATH_DIR}/credentials'


def main():
Expand Down Expand Up @@ -99,6 +100,8 @@ def main():
"would you like to create one? "
"[y/n]".format(AWS_CREDS_PATH))
if create.lower() == "y":
if not os.path.isdir(AWS_USER_PATH_DIR):
os.mkdir(AWS_USER_PATH_DIR)
with open(AWS_CREDS_PATH, 'a'):
pass
else:
Expand Down