Skip to content

Commit

Permalink
Autofetch asset-packs submoduke on reindex
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Sep 8, 2024
1 parent 31d13d9 commit 0e7db8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "files/asset-packs"]
path = files/asset-packs
url = https://github.com/Next-Flip/Asset-Packs.git
ignore = all
5 changes: 5 additions & 0 deletions indexer/src/parsers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import logging
import copy
import subprocess

from .models import *
from .channels import *
Expand Down Expand Up @@ -174,6 +175,10 @@ def parse_asset_packs(directory: str, pack_parser: PackParser) -> dict:
logging.exception(exception_msg)
raise Exception(exception_msg)

# Update git submodule
subprocess.check_call(["git", "fetch"], cwd=directory_path)
subprocess.check_call(["git", "checkout", "origin/dev"], cwd=directory_path)

for cur in sorted(os.listdir(directory_path)):
pack_path = os.path.join(directory_path, cur)
# skip .DS_store files
Expand Down

0 comments on commit 0e7db8f

Please sign in to comment.