Skip to content

Commit

Permalink
use relative directory to make path absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Jun 29, 2021
1 parent dda9615 commit 1f23f21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions coupledmodeldriver/generate/adcirc/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,13 @@ def update_path_relative(
if path is not None:
if not isinstance(path, Path):
path = Path(path)
if relative_directory is None:
relative_directory = Path.cwd()
if relative:
if relative_directory is None:
relative_directory = Path.cwd()
if not isinstance(relative_directory, Path):
relative_directory = Path(relative_directory)
if path.is_absolute():
path = Path(os.path.relpath(path, relative_directory))
elif not path.is_absolute():
path = path.absolute()
path = (relative_directory / path).resolve().absolute()
return path

0 comments on commit 1f23f21

Please sign in to comment.