mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 20:55:44 +00:00
* remove all trailing whitespace * fix one scala file Former-commit-id: c73a66046649b189f5df617fefa6e099b1c05426
22 lines
515 B
Python
Executable File
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)
|