-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Checks needed disk space before starting install #38
base: main
Are you sure you want to change the base?
feat: Checks needed disk space before starting install #38
Conversation
install.ps1
Outdated
@@ -64,6 +64,20 @@ Test-GitVersion | |||
|
|||
$force = $args -contains "--force" | |||
|
|||
# Check if there is enough free space | |||
$requiredSpace = 1100MB # 1100 MiB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How was this value chosen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was near the smallest amount needed to complete the install of shorebird, including the Flutter cache, and pub packages that are pulled down.
Testing was done on MacOS
hdiutil create -size 1250m -fs HFS+ -volname "TestVolume" test.dmg
hdiutil attach test.dmg
HOME=/Volumes/TestVolume ./install.sh
hdiutil detach /Volumes/TestVolume
install.sh
Outdated
@@ -94,6 +94,18 @@ if [ $GIT_VERSION_COMPARISON -eq 2 ]; then | |||
exit 1 | |||
fi | |||
|
|||
# Check if there is enough free space | |||
REQUIRED_SPACE=$((1100 * 1024)) # 1100 MiB in KiB | |||
FREE_SPACE=$(df -k "$(dirname "$(install_dir)")" | tail -1 | awk '{print $4}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really dense line and could stand to be broken up and commented
If this is a distraction from what you need to be focused on feel free to close, not that you didn't already have that capability. 😉 |
Exit early when their likely will not be enough disk space to install shorebird
Description
--force
Attempt to address #27
Type of Change