mirror of
https://github.com/PaiGramTeam/enkanetwork.py-data.git
synced 2024-11-16 04:45:24 +00:00
feat: Add project branch env
This commit is contained in:
parent
edf2bb754d
commit
d549915e0f
5
main.py
5
main.py
@ -30,6 +30,7 @@ LOGGER = logging.getLogger(__name__)
|
||||
USERNAME = os.getenv('GITHUB_USERNAME')
|
||||
REPOSITORY = os.getenv('GITHUB_REPOSITORY')
|
||||
PROJECT_ID = os.getenv('GITHUB_PROJECT_ID')
|
||||
PROJECT_BRANCH = os.getenv('GITHUB_PROJECT_BRANCH')
|
||||
|
||||
# Check is DEV_MODE
|
||||
DEVMODE = sys.argv[1] == "dev" if len(sys.argv) > 1 else False
|
||||
@ -111,7 +112,7 @@ async def main():
|
||||
continue
|
||||
|
||||
await download_json(
|
||||
url=RAW_GIT2.format(PATH=f"{USERNAME}/{REPOSITORY}/-/raw/master/{os.getenv('FOLDER')}/{filename}"),
|
||||
url=RAW_GIT2.format(PATH=f"{USERNAME}/{REPOSITORY}/-/raw/{PROJECT_BRANCH}/{os.getenv('FOLDER')}/{filename}"),
|
||||
filename=filename,
|
||||
path=os.path.join("raw", "data")
|
||||
)
|
||||
@ -122,7 +123,7 @@ async def main():
|
||||
langPath = await request(GIT2.format(PATH=f"/projects/{PROJECT_ID}/repository/tree?recursive=true&path={os.getenv('LANG_FOLDER')}"))
|
||||
for lang in langPath:
|
||||
await download_json(
|
||||
url=RAW_GIT2.format(PATH=f"{USERNAME}/{REPOSITORY}/-/raw/master/{lang['path']}"),
|
||||
url=RAW_GIT2.format(PATH=f"{USERNAME}/{REPOSITORY}/-/raw/{PROJECT_BRANCH}/{lang['path']}"),
|
||||
filename=lang["name"],
|
||||
path=os.path.join("raw", "langs")
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user