diff --git a/nbgitpuller/pull.py b/nbgitpuller/pull.py index f5a7dab..bce5b5f 100644 --- a/nbgitpuller/pull.py +++ b/nbgitpuller/pull.py @@ -154,6 +154,9 @@ def initialize_repo(self): clone_args.extend(['--branch', self.branch_name]) clone_args.extend(["--", self.git_url, self.repo_dir]) yield from execute_cmd(clone_args) + if os.path.exists(os.path.join(self.repo_dir, '.nbgitpuller.script.init')): + logging.info('Running init script') + yield from execute_cmd('. ./.nbgitpuller.script.init', cwd=self.repo_dir, shell=True) logging.info('Repo {} initialized'.format(self.repo_dir)) def reset_deleted_files(self): @@ -343,6 +346,9 @@ def update(self): yield from self.ensure_lock() yield from self.merge() + if os.path.exists(os.path.join(self.repo_dir, '.nbgitpuller.script.update')): + logging.info('Running update script') + yield from execute_cmd('. ./.nbgitpuller.script.update', cwd=self.repo_dir, shell=True) def main(): """