Skip to content

Commit

Permalink
support running .nbgitpuller.script.{init,update} on start
Browse files Browse the repository at this point in the history
  • Loading branch information
jimdigriz committed Apr 1, 2024
1 parent abed309 commit 016c44b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nbgitpuller/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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():
"""
Expand Down

0 comments on commit 016c44b

Please sign in to comment.