mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix visual file loading order. Fix zip imports where directories were not being copied
This commit is contained in:
@ -374,7 +374,10 @@ class Controller:
|
||||
if str(item) == 'server.properties':
|
||||
has_properties = True
|
||||
try:
|
||||
file_helper.move_file(os.path.join(tempDir, item), os.path.join(new_server_dir, item))
|
||||
if not os.path.isdir(os.path.join(tempDir, item)):
|
||||
file_helper.move_file(os.path.join(tempDir, item), os.path.join(new_server_dir, item))
|
||||
else:
|
||||
file_helper.move_dir(os.path.join(tempDir, item), os.path.join(new_server_dir, item))
|
||||
except Exception as ex:
|
||||
logger.error(f'ERROR IN ZIP IMPORT: {ex}')
|
||||
if not has_properties:
|
||||
@ -457,12 +460,16 @@ class Controller:
|
||||
helper.ensure_dir_exists(new_server_dir)
|
||||
helper.ensure_dir_exists(backup_path)
|
||||
has_properties = False
|
||||
print(os.listdir(tempDir))
|
||||
#extracts archive to temp directory
|
||||
for item in os.listdir(tempDir):
|
||||
if str(item) == 'server.properties':
|
||||
has_properties = True
|
||||
try:
|
||||
file_helper.move_file(os.path.join(tempDir, item), os.path.join(new_server_dir, item))
|
||||
if not os.path.isdir(os.path.join(tempDir, item)):
|
||||
file_helper.move_file(os.path.join(tempDir, item), os.path.join(new_server_dir, item))
|
||||
else:
|
||||
file_helper.move_dir(os.path.join(tempDir, item), os.path.join(new_server_dir, item))
|
||||
except Exception as ex:
|
||||
logger.error(f'ERROR IN ZIP IMPORT: {ex}')
|
||||
if not has_properties:
|
||||
|
Reference in New Issue
Block a user