1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-06 03:48:04 +00:00

add clear_workdir and -W for #330

This commit is contained in:
deadc0de6
2021-10-29 18:05:22 +02:00
parent a9439d1f14
commit b39a03479f
4 changed files with 28 additions and 15 deletions

View File

@@ -317,6 +317,14 @@ def cmd_install(opts):
installed = []
# clear the workdir
if opts.install_clear_workdir and not opts.dry:
LOG.dbg('clearing the workdir under {}'.format(opts.workdir))
for root, _, files in os.walk(opts.workdir):
for file in files:
fpath = os.path.join(root, file)
removepath(fpath, logger=LOG)
# execute profile pre-action
LOG.dbg('run {} profile pre actions'.format(len(pro_pre_actions)))
templ = _get_templater(opts)