diff options
Diffstat (limited to 'docker/arch-code-server/china-magic-for-pkgbuild.py')
-rwxr-xr-x | docker/arch-code-server/china-magic-for-pkgbuild.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/docker/arch-code-server/china-magic-for-pkgbuild.py b/docker/arch-code-server/china-magic-for-pkgbuild.py deleted file mode 100755 index 43a4d89..0000000 --- a/docker/arch-code-server/china-magic-for-pkgbuild.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 - -# In China? Good for you! - -import sys -import re - -# read STDIN until EOF -content = sys.stdin.read() - -url = re.search(r"url=(.+)", content).group(1) -if url.startswith('"') and url.endswith('"'): - url = url[1:-1] - -if url.startswith("https://github.com"): # yah, it's github! - content = re.sub(r"\$\{\s*url\s*\}|\$url", url, content) - content = content.replace("https://raw.githubusercontent.com", "https://gh.api.99988866.xyz/https://raw.githubusercontent.com") - content = re.sub(r'https://github\.com/(.+)/(.+)/releases/download', lambda match: f'https://gh.api.99988866.xyz/{match.group(0)}', content) - -# now print the result -print(content) |