Skip to content

Commit

Permalink
copy if can not clone
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyrss committed Jan 10, 2020
1 parent 392ed77 commit fc9b5d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nb2workflow/nbadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ def _execute(self, parameters, progress_bar = True, log_output = True, inplace=F
tmpdir = self.new_tmpdir()
logger.info("new tmpdir: %s", tmpdir)

logger.info(subprocess.check_output(["git","clone",os.path.dirname(os.path.realpath(self.notebook_fn)), tmpdir]))
try:
logger.info(subprocess.check_output(["git","clone",os.path.dirname(os.path.realpath(self.notebook_fn)), tmpdir]))
except:
logger.info("git clone failed, will attempt copytree")
shutil.copytree(os.path.dirname(os.path.realpath(self.notebook_fn)), tmpdir)
else:
tmpdir =os.path.dirname(os.path.realpath(self.notebook_fn))
logger.info("executing inplace, no tmpdir is input dir: %s", tmpdir)
Expand Down

0 comments on commit fc9b5d0

Please sign in to comment.