Skip to content

Commit

Permalink
prepare-release.py: Handle filename patterns to include icons (icon-*…
Browse files Browse the repository at this point in the history
…x*.png)
  • Loading branch information
quentin-st committed Apr 27, 2016
1 parent fe78441 commit 05bf6a3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions prepare-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import argparse
import sys
import os
import glob
import shutil
import json
import zipfile
Expand All @@ -22,7 +23,9 @@
'data/css/fonts/roboto.css',
'data/css/fonts/materialdesignicons.css',

'data/img/*',
'data/img/icon-*x*.png',
'data/img/mdi-check.png',
'data/img/wallpaper*.jpg',

'data/js/injector.js',
'data/js/material-freebox-os.js',
Expand All @@ -49,11 +52,15 @@ def do_release(flavour):
expanded_files = []
files = files_generic + files_flavours[flavour]
for file in files:
if file.endswith('*'):
if file.endswith('/*'): # That's a directory: include all its elements
real_name = file[:-1]
expanded_files.extend(
[os.path.join(dp, f) for dp, dn, filenames in os.walk(real_name) for f in filenames]
)
elif '*' in file: # Find all files matching this pattern
expanded_files.extend(
glob.glob(file)
)
else:
expanded_files.append(file)

Expand Down

0 comments on commit 05bf6a3

Please sign in to comment.