diff options
Diffstat (limited to 'comp.py')
-rwxr-xr-x | comp.py | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -18,13 +18,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ######################################################################################## # This builds live/ folder for Update Server -import subprocess, os, traceback +import subprocess, os, uuid, traceback PATH="/var/www/html/assets" # Delete previous deployment subprocess.call("rm --recursive %s/*" % PATH, shell=True) -rc=[] # Go through every file in raw and give them a hash for path, subdir, files in os.walk("raw/"): @@ -46,7 +45,7 @@ for path, subdir, files in os.walk("raw/"): subprocess.call("convert %s %s/%s" % (fn, PATH, NAME), shell=True) EXT="webp" elif EXT in ["xcf", "psd"]: - pass + continue elif EXT in ["mp3", "ogg"]: subprocess.call("cp %s %s/%s" % (fn, PATH, NAME), shell=True) else: @@ -58,9 +57,14 @@ for path, subdir, files in os.walk("raw/"): # Create blank index page to disable dir listing subprocess.call("touch %s/index.html" % PATH, shell=True) +# TODO: zip everything and provide an all-in-one download? +fn="%s/%s.zip" % (PATH, uuid.uuid4().hex) +subprocess.call('cd %s; find . -printf "%%P\n" | zip -X -9 -@ %s' % (PATH, fn), shell=True) + # Correct permissions subprocess.call("chown -R www-data:www-data %s/*" % PATH, shell=True) subprocess.call("chmod --recursive o-rwx %s/*" % PATH, shell=True) -# TODO: zip everything and provide an all-in-one download? - +print("FILENAME: %s" % fn) +print("Register it in \"token\" value of server config to serve all-in-one downloads.") +print("(This feature might not yet have been implemented, though)") |