Fix destination checks when imaging
This commit is contained in:
parent
b79deefdd6
commit
72787d5c24
1 changed files with 3 additions and 2 deletions
|
|
@ -139,6 +139,7 @@ class BlockPair():
|
||||||
# Imaging
|
# Imaging
|
||||||
self.map_path = pathlib.Path(f'{destination}/Image_{map_name}.map')
|
self.map_path = pathlib.Path(f'{destination}/Image_{map_name}.map')
|
||||||
self.destination = self.map_path.with_suffix('.dd')
|
self.destination = self.map_path.with_suffix('.dd')
|
||||||
|
self.destination.touch()
|
||||||
else:
|
else:
|
||||||
# Cloning
|
# Cloning
|
||||||
self.map_path = pathlib.Path(f'{working_dir}/Clone_{map_name}.map')
|
self.map_path = pathlib.Path(f'{working_dir}/Clone_{map_name}.map')
|
||||||
|
|
@ -235,8 +236,8 @@ class BlockPair():
|
||||||
dest_size = dest_obj.details['size']
|
dest_size = dest_obj.details['size']
|
||||||
del dest_obj
|
del dest_obj
|
||||||
|
|
||||||
# Raise exception if necessary
|
# Check destination size if cloning
|
||||||
if dest_size < self.size:
|
if not self.destination.is_file() and dest_size < self.size:
|
||||||
std.print_error(f'Invalid destination: {self.destination}')
|
std.print_error(f'Invalid destination: {self.destination}')
|
||||||
raise std.GenericAbort()
|
raise std.GenericAbort()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue