Skip to content

CLI should save the cli state of failed runs (degrade gracefully) #536

@whitmo

Description

@whitmo

🐛 Describe the bug

If scaf fails to run, it forget all options previous chosen and forces the user to reenter them.

💭 Expected Behavior

Iterative fixes

  1. populate a config file /tmp/scaf-{template-name}-answers.yaml with old choices (in tmp?) Advertise it's existence on failure.
  2. Add a flag to use config file ala --project-config=answers.yml

🔁 Steps To Reproduce

  1. induce a setup error that occurs in setting up a template (ie turn docker off on full-stack-template)
  2. run again

📝 Additional context

Fundamentally this is a copier layer problem. -C will skip cleanup leaving answers.yml and rendered template, no flag and it cleansup both.

Without changing copier to maintain a bit state between runs, the best solution, though slightly hacky, would be to do clean up on failure in our wrapper script, saving the answers file and prompting the user to use it (either on error or when the next run occurs).

📜 Relevant log output

📸 Screenshots

z

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions