lazybones icon indicating copy to clipboard operation
lazybones copied to clipboard

Verify whether target dir for `create` command already exists

Open pledbrook opened this issue 11 years ago • 5 comments

When the user executes the create command, Lazybones should check whether the target directory exists and whether it's empty or not. If it's not empty, then Lazybones should ask the user whether he or she really wants to install the template in that directory.

A few other options might be:

  • A --force argument to bypass the question and just do it™
  • Ask whether the user wants Lazybones to clear out the directory first
  • A --non-interactive option to automatically abort if the directory isn't empty?

pledbrook avatar Aug 12 '13 20:08 pledbrook

In addition, --non-interactive should force any interactions such as ask to use defaults. non-interactive should also be accessible to the post install script to help complex templates act appropriately.

tbarker9 avatar Aug 12 '13 20:08 tbarker9

I am fine with what you recommend above. Should the combination of --non-interactive and --force clear the directory?

tbarker9 avatar Aug 12 '13 20:08 tbarker9

--force implies --non-interactive in this particular scenario, so the --non-interactive flag should simply be ignored.

A more general --non-interactive feature as you describe really needs its own issue.

pledbrook avatar Aug 12 '13 20:08 pledbrook

Which would be issue #37 :smile:

pledbrook avatar Aug 12 '13 20:08 pledbrook

Hah, forgot I created that.

tbarker9 avatar Aug 12 '13 20:08 tbarker9