Skip to content

Commit

Permalink
Resolve path when symlinking layer and make_relative is False (#492)
Browse files Browse the repository at this point in the history
* resolve path when symlinking layer and make_relative is False

* update changelog
  • Loading branch information
daniel-wer authored Nov 29, 2021
1 parent 8af8141 commit b820532
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions webknossos/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ For upgrade instructions, please check the respective *Breaking Changes* section

### Changed
- Improved performance for calculations with `Vec3Int` and `BoundingBox`. [#461](https://github.com/scalableminds/webknossos-libs/pull/461)
- Resolve path when symlinking layer and make_relative is False (instead of only making it absolute). [#492](https://github.com/scalableminds/webknossos-libs/pull/492)

### Fixed

Expand Down
3 changes: 1 addition & 2 deletions webknossos/webknossos/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def add_symlink_layer(
foreign_layer_symlink_path = (
Path(os.path.relpath(foreign_layer_path, self.path))
if make_relative
else Path(os.path.abspath(foreign_layer_path))
else foreign_layer_path.resolve()
)
os.symlink(foreign_layer_symlink_path, join(self.path, layer_name))
original_layer = Dataset(foreign_layer_path.parent).get_layer(
Expand Down Expand Up @@ -443,7 +443,6 @@ def add_copy_layer(
else:
foreign_layer_path = Path(foreign_layer)

foreign_layer_path = Path(os.path.abspath(foreign_layer_path))
foreign_layer_name = foreign_layer_path.name
layer_name = (
new_layer_name if new_layer_name is not None else foreign_layer_name
Expand Down

0 comments on commit b820532

Please sign in to comment.