mirror of
https://booba.tech/CutTheCord/cutthecord.git
synced 2024-08-15 03:24:52 +00:00
46620
0f8f3bcbb3
- [x] Folder structure - [x] Script updates - [x] XML patches - [x] Move all patches to this repo - [x] Make sure jenkins is ready for new build system Reviewed-on: https://booba.tech/CutTheCord/cutthecord/pulls/2 Co-authored-by: 46620 <46620osu@gmail.com> Co-committed-by: 46620 <46620osu@gmail.com>
25 lines
686 B
Python
25 lines
686 B
Python
import os
|
|
from ctcconfig import *
|
|
|
|
verdata = {}
|
|
|
|
# Get all APKs from the dir
|
|
for file in os.listdir(RESULT_FOLDER):
|
|
if not file.startswith("cutthecord-"):
|
|
continue
|
|
|
|
filedata = file.replace("cutthecord-", "").replace(".apk", "").split("-")
|
|
if filedata[1] not in verdata:
|
|
verdata[filedata[1]] = []
|
|
|
|
verdata[filedata[1]].append(int(filedata[0]))
|
|
|
|
# Delete the older APKs
|
|
for branch in verdata:
|
|
vers = verdata[branch]
|
|
vers.sort()
|
|
if len(vers) <= CLEAN_ARTIFACT_KEEP_COUNT:
|
|
continue
|
|
for ver in vers[0:-1 * CLEAN_ARTIFACT_KEEP_COUNT]:
|
|
file = os.path.join(RESULT_FOLDER, f"cutthecord-{ver}-{branch}.apk")
|
|
os.unlink(file)
|