Skip to content

Commit

Permalink
Update script
Browse files Browse the repository at this point in the history
  • Loading branch information
jn-jairo committed Nov 5, 2023
1 parent 1ffa885 commit 877672f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import os
import subprocess

BASE_PATH = os.path.dirname(os.path.abspath(__file__))

def update_repo(fullpath):
git_path = os.path.join(fullpath, '.git')
requirements_path = os.path.join(fullpath, 'requirements.txt')

if os.path.isdir(git_path):
print(fullpath)

subprocess.run("git pull", shell=True, cwd=fullpath)

if os.path.exists(requirements_path):
subprocess.run("pip install -r requirements.txt", shell=True, cwd=fullpath)

def update_custom_nodes():
for filename in sorted(os.listdir(os.path.join(BASE_PATH, "custom_nodes"))):
fullpath = os.path.join(BASE_PATH, "custom_nodes", filename)

update_repo(fullpath)

update_repo(BASE_PATH)

update_custom_nodes()

0 comments on commit 877672f

Please sign in to comment.