mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-02 06:56:12 +02:00
Always expand all paths (journals, templates, etc) (#1468)
* Refactored path expansion calls into a new path.py file This also fixed bugs with relative journal and template paths. * Update tests for new path functions Also, make the tests specific to Windows, Mac & Linux Co-authored-by: Jonathan Wren <jonathan@nowandwren.com> Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
parent
1ce7ce8bfc
commit
ea6df4705c
9 changed files with 172 additions and 21 deletions
13
jrnl/path.py
Normal file
13
jrnl/path.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
import os.path
|
||||
|
||||
|
||||
def home_dir():
|
||||
return os.path.expanduser("~")
|
||||
|
||||
|
||||
def expand_path(path):
|
||||
return os.path.expanduser(os.path.expandvars(path))
|
||||
|
||||
|
||||
def absolute_path(path):
|
||||
return os.path.abspath(expand_path(path))
|
Loading…
Add table
Add a link
Reference in a new issue