Skip to content

Commit

Permalink
Expand environment variables (#169)
Browse files Browse the repository at this point in the history
Close #164
  • Loading branch information
nunomdc authored and alichtman committed Nov 1, 2018
1 parent 16a9d0c commit eaa2617
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shallow_backup/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ def home_prefix(path):

def expand_to_abs_path(path):
"""
Expands relative and user's home paths to the respective absolute path.
Expands relative and user's home paths to the respective absolute path. Environment
variables found on the input path will also be expanded.
:param path: Path to be expanded.
:return: (str) The absolute path.
"""
expanded_path = os.path.expanduser(path)
expanded_path = os.path.expandvars(expanded_path)
return os.path.abspath(expanded_path)

0 comments on commit eaa2617

Please sign in to comment.