Skip to content

Commit

Permalink
Use source_update_dir to store updates if defined
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Jan 21, 2017
1 parent 7938689 commit e7d8f6b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion update.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import urllib
import zipfile
import os
import sys
import ssl
import httplib
import socket
Expand Down Expand Up @@ -52,6 +53,11 @@ def download():

def update():
from Config import config
if getattr(sys, 'source_update_dir', False):
if not os.path.isdir(sys.source_update_dir):
os.makedirs(sys.source_update_dir)
os.chdir(sys.source_update_dir) # New source code will be stored in different directory

updatesite_path = config.data_dir + "/" + config.updatesite
sites_json = json.load(open(config.data_dir + "/sites.json"))
updatesite_bad_files = sites_json.get(config.updatesite, {}).get("cache", {}).get("bad_files", {})
Expand Down Expand Up @@ -79,7 +85,7 @@ def update():
plugins_enabled.append(dir)
print "Plugins enabled:", plugins_enabled, "disabled:", plugins_disabled

print "Extracting...",
print "Extracting to %s..." % os.getcwd(),
for inner_path in inner_paths:
if ".." in inner_path:
continue
Expand Down

0 comments on commit e7d8f6b

Please sign in to comment.