forked from ublue-os/bluefin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bluefin-cli): Persist State of Cellar
Persist the state of Homebrew's Cellar for ublue-os#768 If the Cellar does not exist. It will be created in the User's home directory. It is then volume mounted into the container making it accessible on any distrobox enter for the container. When using just bluefin-cli, it will relink all packages and reinstall explicitly installed packages.
- Loading branch information
Showing
4 changed files
with
34 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ ! -f /home/linuxbrew/.firstrun ]; then | ||
touch /home/linuxbrew/.firstrun | ||
|
||
# Package Relink | ||
if [ -n "$(ls -A /home/linuxbrew/.linuxbrew/Cellar)" ]; then | ||
echo "Relinking Homebrew Cellar" | ||
/home/linuxbrew/.linuxbrew/bin/brew list -1 | while read line | ||
do | ||
/home/linuxbrew/.linuxbrew/bin/brew unlink $line | ||
/home/linuxbrew/.linuxbrew/bin/brew link $line | ||
done | ||
echo "Reinstalling explicictly installed Homebrew packages" | ||
/home/linuxbrew/.linuxbrew/bin/brew leaves | while read line | ||
do | ||
/home/linuxbrew/.linuxbrew/bin/brew reinstall $line | ||
done | ||
fi | ||
fi |