Skip to content

Commit

Permalink
Automatically remove boo2.flag's
Browse files Browse the repository at this point in the history
except atmosphere and tesla.
  • Loading branch information
Slluxx committed Feb 3, 2021
1 parent 8cd1d39 commit a44bcad
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/basemodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import zipfile
import shutil
import argparse
import glob

parser = argparse.ArgumentParser(description="TeamNeptune's DeepSea build script.")
requiredNamed = parser.add_argument_group('Options required to build a release candidate')
Expand Down Expand Up @@ -85,6 +86,16 @@ def removeFile(self, filepath):
if os.path.exists(filepath):
os.remove(filepath)

def findAndRemove(self, filename):
if self.__module__ != "modules.atmosphere" or self.__module__ != "modules.ovlloader":
search = Path.joinpath(self.workspaceFullPath, "**", filename)
fileList = glob.glob(str(search), recursive=True)
for filePath in fileList:
try:
os.remove(filePath)
except:
pass

def copyFolderContentToPackage(self, source_dir, target_dir=""):
if source_dir is None:
return None
Expand All @@ -96,4 +107,5 @@ def handleModule(self):
release = self.getLatestRelease()
assetName = self.downloadAsset(release)
extracted = self.unpackAsset(assetName)
self.findAndRemove("boot2.flag")
self.copyFolderContentToPackage(extracted)
6 changes: 6 additions & 0 deletions modules/deepseacleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
class Deepseacleaner(Basemodule):
def __init__(self, config):
Basemodule.__init__(self, config)

def handleModule(self):
release = self.getLatestRelease()
assetName = self.downloadAsset(release)
extracted = self.unpackAsset(assetName)
self.copyFolderContentToPackage(extracted)


package = Deepseacleaner(config)
1 change: 1 addition & 0 deletions modules/emuiibo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def handleModule(self):
assetName = self.downloadAsset(release)
extracted = self.unpackAsset(assetName)
extracted = Path.joinpath(extracted, "SdOut")
self.findAndRemove("boot2.flag")
self.copyFolderContentToPackage(extracted)

package = Emuiibo(config)

0 comments on commit a44bcad

Please sign in to comment.