lazybones
lazybones copied to clipboard
Verify whether target dir for `create` command already exists
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?
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.
I am fine with what you recommend above. Should the combination of --non-interactive
and --force
clear the directory?
--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.
Which would be issue #37 :smile:
Hah, forgot I created that.