Skip to content

Commit

Permalink
Fix config edit when missing dir blowing up with FileNotFoundError
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarnett committed Oct 4, 2024
1 parent f79d63e commit a227877
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
v4.5.1
* Fix gcalcli failing to run on python 3.10 if config file is present
* Fix `config edit` when missing config dir blowing up with FileNotFoundError
* Fix bizarre SSL recursion errors by moving truststore init earlier
* Fix redundant "Ignore and refresh" prompt from `init`
* Adjust "when" value parsing to handle YYYY-MM-DD consistently
Expand Down
3 changes: 2 additions & 1 deletion gcalcli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,10 @@ def main():
if parsed_args.subcommand == 'edit':
printer.msg(
f'Launching {utils.shorten_path(config_filepath)} in a '
'text editor...'
'text editor...\n'
)
if not config_filepath.exists():
config_filepath.parent.mkdir(parents=True, exist_ok=True)
with open(config_filepath, 'w') as f:
f.write(EMPTY_CONFIG_TOML)
utils.launch_editor(config_filepath)
Expand Down

0 comments on commit a227877

Please sign in to comment.