Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[*.py]
indent_style = space
indent_size = 4

[*.{yml,yaml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
2 changes: 2 additions & 0 deletions src/specify_cli/workflows/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def _register_builtin_steps() -> None:
from .steps.prompt import PromptStep
from .steps.shell import ShellStep
from .steps.switch import SwitchStep
from .steps.validate import ValidateStep
from .steps.while_loop import WhileStep

_register_step(CommandStep())
Expand All @@ -62,6 +63,7 @@ def _register_builtin_steps() -> None:
_register_step(PromptStep())
_register_step(ShellStep())
_register_step(SwitchStep())
_register_step(ValidateStep())
_register_step(WhileStep())


Expand Down
12 changes: 10 additions & 2 deletions src/specify_cli/workflows/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,11 @@ def load(cls, run_id: str, project_root: Path) -> RunState:
raise FileNotFoundError(msg)

with open(state_path, encoding="utf-8") as f:
state_data = json.load(f)
try:
state_data = json.load(f)
except json.JSONDecodeError as exc:
msg = f"Corrupted run state file: {state_path}: {exc}"
raise ValueError(msg) from exc

state = cls(
run_id=state_data["run_id"],
Expand All @@ -306,7 +310,11 @@ def load(cls, run_id: str, project_root: Path) -> RunState:
inputs_path = runs_dir / "inputs.json"
if inputs_path.exists():
with open(inputs_path, encoding="utf-8") as f:
inputs_data = json.load(f)
try:
inputs_data = json.load(f)
except json.JSONDecodeError as exc:
msg = f"Corrupted inputs file: {inputs_path}: {exc}"
raise ValueError(msg) from exc
state.inputs = inputs_data.get("inputs", {})

return state
Expand Down
Loading