-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make it so it adds pack.json also add template
- Loading branch information
Showing
5 changed files
with
60 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Discord Community | ||
about: "Chat with us: https://discord.gg/RwbRP8ADdc" | ||
about: "Chat with us: https://discord.gg/RwbRP8ADdc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import json | ||
import hashlib | ||
import os | ||
import sys | ||
import zipfile | ||
import urllib.request | ||
import re | ||
from pathlib import Path | ||
import subprocess | ||
import time | ||
|
||
def fail(msg): | ||
print(f'Fail: {msg}', file=sys.stderr) | ||
sys.exit(1) | ||
|
||
|
||
def sanitize_name(name): | ||
return ((((''.join(c for c in name if c.isalnum() or c in ['.'] or c in [' '] or c in ['_'] or c in ['-']))).replace(" ", "_")).replace("-", "_")).replace(".", "_").replace("Clicks", "") | ||
|
||
|
||
def save(clickName, folderName, ee): | ||
print(clickName) | ||
print(folderName) | ||
print(ee) | ||
if os.getenv('GITHUB_OUTPUT'): | ||
with open(os.getenv('GITHUB_OUTPUT'), 'a') as file: | ||
file.write(f'click_name={clickName}\nfolder={folderName}\ntype={ee}\n') | ||
|
||
issue_body = os.environ['ISSUE_BODY'].replace("\r", "") | ||
|
||
if 'Click Sound Name' not in issue_body or "Add Pack" not in issue_body: | ||
print('Not a valid entry', file=sys.stderr) | ||
sys.exit(2) | ||
|
||
try: | ||
match = re.search(r'\s*?### Add Pack\s*?(\S+)\s*?', issue_body) | ||
#print(match) | ||
time.sleep(2) | ||
if match: | ||
click_url = matchfound[(matchfound.find("(") + 1):-1] | ||
urllib.request.urlretrieve(click_url, 'test/' + folderName + '.zip') | ||
clickName = match2.group(1) | ||
folderName = sanitize_name(clickName) | ||
matchfound = match.group(1) | ||
typee = match3.group(1) | ||
if typee != "Useful" and typee != "Meme": | ||
fail('Click Type must be \"Useful\" or \"Release\"') | ||
save(clickName, folderName, typee) | ||
else: | ||
fail(f'Could not find the zip link') | ||
|
||
except Exception as inst: | ||
fail(f'Could not download the zip file: {inst}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.