Skip to content

Commit ea0dc1a

Browse files
CodyCBakerPhDeffigies
authored andcommitted
[FIX] schemapath resolution in dev mode install of bidsschematools (#2129)
1 parent 0960ac9 commit ea0dc1a

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/appendices/contributors.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ If you contributed to the BIDS ecosystem and your name is not listed, please add
107107
| Christopher Lee-Messer | 📖 |
108108
| Clara Moreau | 📖 |
109109
| Clint Hansen | 📖🤔 |
110+
| Cody Baker | 💻🔧 |
110111
| Cyril Pernet | 💬📝📖🎨💡📋🤔📢 |
111112
| Cyrus Eierud | 📖 |
112113
| D. Sturgeon | 💻 |

tools/schemacode/JsonschemaValidator

Whitespace-only changes.

tools/schemacode/src/bidsschematools/schema.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ def load_schema(schema_path=None):
205205
schema_path = data.load.readable("schema.json")
206206
if not schema_path.is_file():
207207
schema_path = data.load.readable("schema")
208+
209+
# Probably a Windows checkout with a git link. Resolve first.
210+
if schema_path.is_file() and (content := schema_path.read_text()).startswith("../"):
211+
schema_path = Path.resolve(schema_path.parent / content)
208212
lgr.info("No schema path specified, defaulting to the bundled schema, `%s`.", schema_path)
209213
elif isinstance(schema_path, str):
210214
schema_path = Path(schema_path)

0 commit comments

Comments
 (0)