Skip to content

Commit 503f26d

Browse files
mzuennimpsijm
authored andcommitted
fix version check
1 parent 438eae6 commit 503f26d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

bin/skel.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,10 @@ def new_problem() -> None:
153153
skeldir, preserve_symlinks = get_skel_dir(target_dir)
154154
log(f"Copying {skeldir} to {target_dir / dirname}.")
155155

156-
skel_yaml = read_yaml(skeldir / "problem.yaml")
157-
if (
158-
"problem_format_version" not in skel_yaml
159-
or skel_yaml["problem_format_version"] not in config.SPEC_VERSION
160-
):
156+
skel_yaml = (skeldir / "problem.yaml").read_text()
157+
if not any(version in skel_yaml for version in config.SPEC_VERSION):
161158
fatal(
162-
f"new_problem only supports `skel` directories where `problem.yaml` has `version: {config.SPEC_VERSION[0]}."
159+
f"new_problem only supports `skel` directories where `problem.yaml` has version: {config.SPEC_VERSION[0]}."
163160
)
164161

165162
problems_yaml = target_dir / "problems.yaml"

0 commit comments

Comments
 (0)