Skip to content

Commit 398512e

Browse files
author
Agil Mammadov
authored
Merge pull request #24 from stiermid/fix-minor-bugs
fix: three minor code quality fixes
2 parents 92fae76 + cb534c6 commit 398512e

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

nnote/commands/backup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def backup(output_path, directory, include_config, dry_run, quiet):
4141
if not root.exists():
4242
raise click.ClickException(f"Directory not found: {root}")
4343

44-
config_path = Path("~/.config/nnote/config.yaml").expanduser()
44+
config_path = config.path
4545

4646
if dry_run:
4747
count = 0

nnote/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def save(self) -> None:
5252
with os.fdopen(fd, "w", encoding="utf-8") as f:
5353
yaml.dump(self._data, f, default_flow_style=False, allow_unicode=True)
5454
Path(tmp).replace(self._path)
55-
except:
55+
except Exception:
5656
os.unlink(tmp)
5757
raise
5858

nnote/notes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ def open_in_editor(config: Config, path: Path) -> None:
2222
raise click.ClickException(
2323
"No editor configured. Set 'editor' in config or the $EDITOR environment variable."
2424
)
25-
subprocess.call([config.editor, str(path)])
25+
subprocess.run([config.editor, str(path)], check=False)

0 commit comments

Comments
 (0)