changed __enter__

This commit is contained in:
advaithm 2021-04-02 10:16:48 +05:30
parent 655ec06119
commit 6b218e555b
No known key found for this signature in database
GPG Key ID: E557E45E6DAFFC0C
1 changed files with 5 additions and 3 deletions

View File

@ -67,9 +67,11 @@ class Installer():
log(*args, level=level, **kwargs)
def __enter__(self, *args, **kwargs):
self.partition.mount(self.mountpoint)
os.makedirs(f'{self.mountpoint}/boot', exist_ok=True)
self.boot_partition.mount(f'{self.mountpoint}/boot')
if hasUEFI():
# on bios we don't have a boot partition
self.partition.mount(self.mountpoint)
os.makedirs(f'{self.mountpoint}/boot', exist_ok=True)
self.boot_partition.mount(f'{self.mountpoint}/boot')
return self
def __exit__(self, *args, **kwargs):