Skip to content

Commit 2e64e3f

Browse files
committed
main: Explicitly fail resize prompt if there is too much overhead
People are getting confused by the unfullfillable min/max and not reading the message above the prompt... Signed-off-by: Hector Martin <[email protected]>
1 parent af7fe85 commit 2e64e3f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/main.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,16 @@ def action_resize(self, resizable):
728728
print()
729729
p_plain( f" {col(BLUE, BRIGHT)}https://alx.sh/tmcleanup{col()}")
730730
print()
731+
732+
if avail < 2 * PART_ALIGN:
733+
p_warning("Not enough available space to resize. Please follow the instructions")
734+
p_warning("above to continue.")
735+
return False
736+
737+
if avail < 2 * PART_ALIGN:
738+
p_warning("Not enough available space to resize.")
739+
return False
740+
731741
p_question("Enter the new size for your existing partition:")
732742
p_message( " You can enter a size such as '1GB', a fraction such as '50%',")
733743
p_message( " or the word 'min' for the smallest allowable size.")

0 commit comments

Comments
 (0)