mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
Add cleanup upon update
This commit is contained in:
parent
7aff860390
commit
70acfc22e7
2 changed files with 18 additions and 1 deletions
|
@ -24,6 +24,7 @@ except ImportError:
|
||||||
sys.ext('Please install pywin32')
|
sys.ext('Please install pywin32')
|
||||||
|
|
||||||
APP_ROOT = libs.util.module_path(parent=True)
|
APP_ROOT = libs.util.module_path(parent=True)
|
||||||
|
SOURCE_ROOT = libs.util.module_path()
|
||||||
|
|
||||||
# init preliminaries
|
# init preliminaries
|
||||||
SYS_ARGV = sys.argv[1:]
|
SYS_ARGV = sys.argv[1:]
|
||||||
|
|
|
@ -15,6 +15,7 @@ from six.moves.urllib.request import urlretrieve
|
||||||
|
|
||||||
import core
|
import core
|
||||||
from core import github_api as github, logger
|
from core import github_api as github, logger
|
||||||
|
import libs.util
|
||||||
|
|
||||||
|
|
||||||
class CheckVersion(object):
|
class CheckVersion(object):
|
||||||
|
@ -79,7 +80,22 @@ class CheckVersion(object):
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
if self.updater.need_update():
|
if self.updater.need_update():
|
||||||
return self.updater.update()
|
result = self.updater.update()
|
||||||
|
self.clean()
|
||||||
|
return result
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def clean():
|
||||||
|
# Clean libs
|
||||||
|
libs.util.git_clean(
|
||||||
|
remove_directories=True,
|
||||||
|
force=True,
|
||||||
|
ignore_rules=True,
|
||||||
|
paths=[
|
||||||
|
libs.LIB_ROOT,
|
||||||
|
core.SOURCE_ROOT,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class UpdateManager(object):
|
class UpdateManager(object):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue