Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Drapersniper committed Dec 3, 2023
1 parent 1653ae6 commit 285ccce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
13 changes: 5 additions & 8 deletions root/app/functions/pylav_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@

log = logging.getLogger("PyLavSetup")


DEV_PYLAV = os.environ.get("PYLAV__DEV_LIB")
DEV_PYLAV_COGS = os.environ.get("PYLAV__DEV_COG")
DEV_BRANCH = os.environ.get("PYLAV__DEV_BRANCH", "develop")


with pathlib.Path("/data/config.json").open("r", encoding="utf-8") as __f:
IS_JSON = json.load(__f)["docker"]["STORAGE_TYPE"].upper() == "JSON"


if not IS_JSON:
RepoManagerRepoFolder = DATA_FOLDER / "git-cogs"

Expand Down Expand Up @@ -89,7 +86,6 @@ def clone_or_update_pylav_repo() -> str:


def get_pylav_cogs() -> Dict[str, pathlib.Path]:

return (
{
cog.name: cog
Expand All @@ -105,7 +101,8 @@ def get_pylav_cogs() -> Dict[str, pathlib.Path]:
)


def copy_and_overwrite(from_path: Union[str, os.PathLike[str]], to_path: Union[str, os.PathLike[str]], symlink: bool = False) -> None:
def copy_and_overwrite(from_path: Union[str, os.PathLike[str]], to_path: Union[str, os.PathLike[str]],
symlink: bool = False) -> None:
if os.path.exists(to_path):
if not os.path.islink(to_path):
shutil.rmtree(to_path)
Expand Down Expand Up @@ -139,7 +136,7 @@ def get_requirements_for_all_cogs(cogs: Dict[str, pathlib.Path]) -> Set[str]:


def install_requirements(
cogs: Dict[str, pathlib.Path]
cogs: Dict[str, pathlib.Path]
) -> tuple[
subprocess.Popen[str] | subprocess.Popen[str | bytes | Any] | None,
subprocess.Popen[str] | subprocess.Popen[str | bytes | Any] | None,
Expand All @@ -150,7 +147,7 @@ def install_requirements(
log.info("Installing requirements: %s", requirements)
proc = subprocess.Popen(
[
sys.executable,
sys.executable,
"-m",
"pip",
"install",
Expand Down Expand Up @@ -210,7 +207,7 @@ def install_requirements(


def generate_updated_downloader_setting(
cogs: Dict[str, pathlib.Path], commit_hash: str
cogs: Dict[str, pathlib.Path], commit_hash: str
) -> Dict[str, Dict[str, Union[str, bool]]]:
return {
cog.name: {
Expand Down
8 changes: 2 additions & 6 deletions root/app/functions/update-redbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ if [ "${STORAGE_TYPE}" != "json" ]; then
fi

if [ -z "${PYLAV__DOCKER_DEV_SKIP_INSTALL:-}" ]; then
# Clone/Pull/Install/Update PyLav Cogs
python /app/functions/pylav_setup.py
fi

if [ -z "${PYLAV__DOCKER_DEV_SKIP_INSTALL:-}" ]; then
# Clone/Pull/Install/Update PyLav Cogs
git git config --global --add safe.directory $PYLAV__DEV_LIB || true
git git config --global --add safe.directory $PYLAV__DEV_COG || true
python /app/functions/pylav_setup.py
fi

Expand Down
1 change: 1 addition & 0 deletions root/app/start-redbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -euf
# Perform mount check
/app/functions/check-mount.sh


# Setup environment
. /app/functions/setup-env.sh

Expand Down

0 comments on commit 285ccce

Please sign in to comment.