Files
eagle0/installdata/scripts/prune_main.py
T
adminandGitHub e08f327bd1 remove all trailing whitespace (#2344)
* remove all trailing whitespace

* fix one scala file


Former-commit-id: c73a66046649b189f5df617fefa6e099b1c05426
2022-11-23 08:22:25 -08:00

22 lines
515 B
Python
Executable File

#!/usr/bin/env python3
import os
import shutil
import sys
def files(path):
for file in os.listdir(path):
if os.path.isdir(os.path.join(path, file)):
yield os.path.join(path, file)
current_build_number = int(sys.argv[1])
base = "/home/eagle0/bin/deploy/main/"
for file in os.listdir(base):
os.chdir(base)
if file.isnumeric() and os.path.isdir(file):
if int(file) < current_build_number - 1:
print('Removing old build ' + file)
shutil.rmtree(file)