Skip to content

Commit

Permalink
Allow to create a workdir in an existing dir
Browse files Browse the repository at this point in the history
Ther is no reason to fail 'lago init' if a user want
to create the workdir in an existing directory.

Signed-off-by: gbenhaim <[email protected]>
  • Loading branch information
gbenhaim committed Apr 1, 2018
1 parent 1b34146 commit 91c148c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lago/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ def do_init(
with log_utils.LogTask('Initialize and populate prefix', LOGGER):
LOGGER.debug('Using workdir %s', workdir)
workdir = lago_workdir.Workdir(workdir)
if not os.path.exists(workdir.path):
if not (
os.path.exists(workdir.path)
and lago.workdir.Workdir.is_workdir(workdir.path)
):
LOGGER.debug(
'Initializing workdir %s with prefix %s',
workdir.path,
Expand Down

0 comments on commit 91c148c

Please sign in to comment.