Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

garrettApproachableGeek

Exit early when their likely will not be enough disk space to install shorebird

Description

  • Sets baseline of 1100 MiB of disk space needed to preform the install
  • Users can still force an install using --force

Attempt to address #27

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@eseidel eseidel requested a review from bryanoltman December 18, 2024 20:14
install.ps1 Outdated
@@ -64,6 +64,20 @@ Test-GitVersion

$force = $args -contains "--force"

# Check if there is enough free space
$requiredSpace = 1100MB # 1100 MiB
Copy link
Contributor

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?

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}')
Copy link
Contributor

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

@garrettApproachableGeek
Copy link
Author

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. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants