diff --git a/scripts/init.py b/scripts/init.py index a13a276..6d15b1f 100755 --- a/scripts/init.py +++ b/scripts/init.py @@ -43,10 +43,6 @@ def create_dirs( config ): create_dir( BASE_DIR / config['OUTPUT_DIR'] ) - copy_dir( - BASE_DIR / config['DEPENDENCIES_DIR'] / 'eoa-publication-model/examples', - BASE_DIR / config['INPUT_DIR'] / 'example' - ) def install_git_dep( repo_name, @@ -56,10 +52,12 @@ def install_git_dep( init_script = None, ): DEP_DIR = BASE_DIR / config['DEPENDENCIES_DIR'] - if not((DEP_DIR / repo_name).exists()) or force: + # remove repo, if necessary: + if force: if (DEP_DIR / repo_name).exists(): shutil.rmtree( DEP_DIR / repo_name ) + if not((DEP_DIR / repo_name).exists()): subprocess.check_call( ["git", "clone", repo_uri, DEP_DIR / repo_name] ) @@ -128,4 +126,10 @@ def install_git_dep( env = config, ) + # copy example publication to $INPUT_DIR + copy_dir( + BASE_DIR / config['DEPENDENCIES_DIR'] / 'eoa-publication-model/examples', + BASE_DIR / config['INPUT_DIR'] / 'example' + ) + print( "done." )