mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
copy plugins dir on upgrade
This commit is contained in:
parent
74e78e6623
commit
5bad0fb879
1 changed files with 3 additions and 0 deletions
|
@ -38,6 +38,7 @@ def run():
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
if 'APPDATA' in os.environ:
|
if 'APPDATA' in os.environ:
|
||||||
oldConf = os.path.expanduser("~/.anki/config.db")
|
oldConf = os.path.expanduser("~/.anki/config.db")
|
||||||
|
oldPlugins = os.path.expanduser("~/.anki/plugins")
|
||||||
os.environ['HOME'] = os.environ['APPDATA']
|
os.environ['HOME'] = os.environ['APPDATA']
|
||||||
else:
|
else:
|
||||||
oldConf = None
|
oldConf = None
|
||||||
|
@ -49,6 +50,8 @@ def run():
|
||||||
if os.path.exists(oldConf):
|
if os.path.exists(oldConf):
|
||||||
shutil.copy2(oldConf,
|
shutil.copy2(oldConf,
|
||||||
os.path.expanduser("~/.anki/config.db"))
|
os.path.expanduser("~/.anki/config.db"))
|
||||||
|
shutil.copytree(oldPlugins,
|
||||||
|
os.path.expanduser("~/.anki/plugins"))
|
||||||
os.rename(oldConf, oldConf.replace("config.db", "config.db.old"))
|
os.rename(oldConf, oldConf.replace("config.db", "config.db.old"))
|
||||||
|
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
|
|
Loading…
Reference in a new issue