mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 13:36:14 +02:00
Create journal with absolute path when no path is specified (#972)
* create jrnl with abspath Co-authored-by: = <esrh@netc.eu>
This commit is contained in:
parent
d9951b54c0
commit
2a3fd820b9
4 changed files with 21 additions and 2 deletions
|
@ -2,6 +2,8 @@ import os
|
|||
import shutil
|
||||
import sys
|
||||
|
||||
CWD = os.getcwd()
|
||||
|
||||
|
||||
def clean_all_working_dirs():
|
||||
for folder in ("configs", "journals", "cache"):
|
||||
|
@ -26,7 +28,6 @@ def before_scenario(context, scenario):
|
|||
"""Before each scenario, backup all config and journal test data."""
|
||||
# Clean up in case something went wrong
|
||||
clean_all_working_dirs()
|
||||
|
||||
for folder in ("configs", "journals"):
|
||||
original = os.path.join("features", "data", folder)
|
||||
working_dir = os.path.join("features", folder)
|
||||
|
@ -52,4 +53,6 @@ def before_scenario(context, scenario):
|
|||
|
||||
def after_scenario(context, scenario):
|
||||
"""After each scenario, restore all test data and remove working_dirs."""
|
||||
if os.getcwd() != CWD:
|
||||
os.chdir(CWD)
|
||||
clean_all_working_dirs()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue