Skip to content

fix(backend): expand vars for rc and data location #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
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
4 changes: 3 additions & 1 deletion tasklib/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def __init__(self, data_location=None, create=True,
version_override=None):
self.taskrc_location = None
if taskrc_location:
self.taskrc_location = os.path.expanduser(taskrc_location)
self.taskrc_location = os.path.expandvars(taskrc_location)
self.taskrc_location = os.path.expanduser(self.taskrc_location)

# If taskrc does not exist, pass / to use defaults and avoid creating
# dummy .taskrc file by TaskWarrior
Expand All @@ -121,6 +122,7 @@ def __init__(self, data_location=None, create=True,

# Set data.location override if passed via kwarg
if data_location is not None:
data_location = os.path.expandvars(data_location)
data_location = os.path.expanduser(data_location)
if create and not os.path.exists(data_location):
os.makedirs(data_location)
Expand Down