Fix wo update

This commit is contained in:
VirtuBox
2019-06-17 11:56:33 +02:00
parent 8140394b5a
commit dbffa22412

View File

@@ -30,28 +30,37 @@ class WOUpdateController(CementBaseController):
@expose(hide=True) @expose(hide=True)
def default(self): def default(self):
filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S") filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S")
WODownload.download(self, [["https://raw.githubusercontent.com/"
"WordOps/WordOps/updating-configuration/install", if self.app.pargs.travis:
"/tmp/{0}".format(filename), WODownload.download(self, [["https://raw.githubusercontent.com/"
"update script"]]) "WordOps/WordOps/updating-configuration/install",
if self.app.pargs.force: "/tmp/{0}".format(filename),
"update script"]])
try: try:
Log.info(self, "updating WordOps, please wait...") Log.info(self, "updating WordOps, please wait...")
os.system("bash /tmp/{0} --force".format(filename)) os.system("bash /tmp/{0} --travis --force".format(filename))
except OSError as e: except OSError as e:
Log.debug(self, str(e)) Log.debug(self, str(e))
Log.error(self, "WordOps update failed !") Log.error(self, "WordOps update failed !")
else: else:
try: WODownload.download(self, [["https://raw.githubusercontent.com/"
Log.info(self, "updating WordOps, please wait...") "WordOps/WordOps/master/install",
os.system("bash /tmp/{0}".format(filename)) "/tmp/{0}".format(filename),
except OSError as e: "update script"]])
Log.debug(self, str(e)) if self.app.pargs.force:
Log.error(self, "WordOps update failed !") try:
if self.app.pargs.travis: Log.info(self, "updating WordOps, please wait...")
try: os.system("bash /tmp/{0} --force".format(filename))
Log.info(self, "updating WordOps, please wait...") except OSError as e:
os.system("bash /tmp/{0} --travis --force".format(filename)) Log.debug(self, str(e))
Log.error(self, "WordOps update failed !")
else:
try:
Log.info(self, "updating WordOps, please wait...")
os.system("bash /tmp/{0}".format(filename))
except OSError as e:
Log.debug(self, str(e))
Log.error(self, "WordOps update failed !")
def load(app): def load(app):