mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-10 01:17:42 +01:00
Restore config fix for windows
This commit is contained in:
parent
8320853399
commit
50677a2a3e
2 changed files with 11 additions and 5 deletions
|
@ -1 +1 @@
|
|||
__version__ = "4.0.1.4"
|
||||
__version__ = "4.0.1.5"
|
||||
|
|
|
@ -10,6 +10,7 @@ from cbpi.utils.utils import load_config
|
|||
from zipfile import ZipFile
|
||||
from cbpi.craftbeerpi import CraftBeerPi
|
||||
import os
|
||||
import platform
|
||||
import pathlib
|
||||
import shutil
|
||||
import yaml
|
||||
|
@ -152,12 +153,17 @@ def check_for_setup():
|
|||
if zip_content == True:
|
||||
print("Found correct content. Starting Restore process")
|
||||
output_path = pathlib.Path(os.path.join(".", 'config'))
|
||||
system = platform.system()
|
||||
print(system)
|
||||
if system != "Windows":
|
||||
owner = output_path.owner()
|
||||
group = output_path.group()
|
||||
print("Removing old config folder")
|
||||
shutil.rmtree(output_path, ignore_errors=True)
|
||||
print("Extracting zip file to config folder")
|
||||
zip.extractall(output_path)
|
||||
zip.close()
|
||||
if system != "Windows":
|
||||
print("Changing owner and group of config folder recursively to {}:{}".format(owner,group))
|
||||
recursive_chown(output_path, owner, group)
|
||||
print("Removing backup file")
|
||||
|
|
Loading…
Reference in a new issue