Skip to content

build: fail when the output directory exists; add --force to replace a generated study - #718

Open
yadavchiragg wants to merge 1 commit into
ControlCore-Project:devfrom
yadavchiragg:feat/build-force
Open

yadavchiragg wants to merge 1 commit into
ControlCore-Project:devfrom
yadavchiragg:feat/build-force

Conversation

@yadavchiragg

Copy link
Copy Markdown

Fixes #717

concore build into an existing output directory printed a warning and returned, so the exit code was 0 and nothing was built (CI/scripts then ran a stale study). Rebuilding also required deleting the folder by hand.

  • An existing output directory is now an error (exit 1) that mentions --force.
  • New --force replaces the output directory, but only if it looks like a study generated by concore (it has a build and a run script). It refuses regular files, directories without those scripts (e.g. a concore init project), the current directory, the home directory, and any directory that contains the workflow or the sources.
  • README updated.

Added tests/test_build_force.py (6 tests: error without --force, replace with --force, and each refusal case). The existing "already exists" test in test_cli.py still passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant