mirror of
https://github.com/xgui4/LCE-Qt-Launcher.git
synced 2026-07-16 01:30:39 +00:00
19 lines
876 B
Python
19 lines
876 B
Python
import subprocess
|
|
import os
|
|
|
|
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
|
|
class CustomBuildHook(BuildHookInterface): # pyright: ignore[reportMissingTypeArgument]
|
|
def clean(self, versions) -> None: # pyright: ignore[reportMissingParameterType]
|
|
if os.name == "posix":
|
|
_ = subprocess.run("./scripts/clean.sh", check=True)
|
|
if os.name == "nt":
|
|
_ = subprocess.run("scripts\\clean.cmd", check=True, shell=True)
|
|
return super().clean(versions)
|
|
|
|
def initialize(self, version, build_data) -> None: # pyright: ignore[reportMissingParameterType]
|
|
if os.name == "posix":
|
|
_ = subprocess.run("./scripts/build.sh", check=True)
|
|
if os.name == "nt":
|
|
_ = subprocess.run("scripts\\build.cmd", check=True, shell=True)
|
|
return super().initialize(version, build_data) |