Skip to content

Commit

Permalink
Remove release binaries before finalizing the build
Browse files Browse the repository at this point in the history
  • Loading branch information
ajhall committed Mar 29, 2024
1 parent 949e35e commit b2dd486
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions devyco/modules/releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,18 @@ def _run(self):

target = conf.get('dir', '.')

all_files = map(path.basename, self.list_files(relative=target))
if not all_files and conf.get('abortIfEmpty', False):
files = self.list_files(relative=target)
file_basenames = map(path.basename, files)
if not file_basenames and conf.get('abortIfEmpty', False):
return

versions = extract_versions(all_files)
versions = extract_versions(file_basenames)

entries = []
for v in versions:
entries.append({
"version": v,
"files": extract_files(v, all_files, path.join(self._target, target))
"files": extract_files(v, file_basenames, path.join(self._target, target))
})

tplt = self.get_template('releases')
Expand Down Expand Up @@ -156,6 +157,10 @@ def _run(self):
with open(htaccess, 'a') as f:
f.writelines(redirects)

# Remove actual releases (moved to Google Cloud Storage)
for f in files:
os.remove(f)

def _create_latest(self, entries, path, relpath):
ret = 'RewriteEngine On\n'
created = {}
Expand Down

0 comments on commit b2dd486

Please sign in to comment.