Skip to content

Commit 733ecf2

Browse files
committed
Fix issue #53: use package target instead of default-target for path
The bug was in config.py line 103, which used the 'target' variable (always equal to default-target) instead of package["target"] (which may contain a custom per-package target setting). This fix ensures that: - Packages with custom target settings are checked out to their specified directory - Packages without custom target continue to use default-target - Variable interpolation like ${settings:docs-directory} works correctly The previously failing test now passes, demonstrating the fix works. Fixes #53
1 parent ef5b4d3 commit 733ecf2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## 4.1.2 (unreleased)
44

5+
- Fix #53: Per-package target setting now correctly overrides default-target when constructing checkout paths.
6+
[jensens]
7+
58
- Fix #55: UnicodeEncodeError on Windows when logging emoji. The emoji is now conditionally displayed only when the console encoding supports it (UTF-8), avoiding errors on Windows cp1252 encoding.
69
[jensens]
710

src/mxdev/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ def is_ns_member(name) -> bool:
100100
package.setdefault("install-mode", mode)
101101
package.setdefault("vcs", "git")
102102
# XXX: path should not be necessary in WorkingCopies
103-
package.setdefault("path", os.path.join(target, name))
103+
# Use package["target"] not 'target' variable to respect per-package target setting (#53)
104+
package.setdefault("path", os.path.join(package["target"], name))
104105
if not package.get("url"):
105106
raise ValueError(f"Section {name} has no URL set!")
106107
if package.get("install-mode") not in ["direct", "skip"]:

0 commit comments

Comments
 (0)