Skip to content

Commit

Permalink
Added notification system.
Browse files Browse the repository at this point in the history
Currently notifies users of issue when base php version changes.

Only will notify one time.
  • Loading branch information
kazajhodo committed Feb 26, 2020
1 parent af51e05 commit 0f7f037
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions .updated
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

# Placeholder to notify user settings have been updated.
updated=false
notification=true
33 changes: 33 additions & 0 deletions include/notification
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/zsh

# Used to notify user.
if [[ $notification = true ]]; then
echo
echo
echo 'Warning: Brew will attempt to remove old php versions from your system when upgrading.'
echo
echo 'When it does this, it will ask you to delete the old php versions.'
echo 'If you still need them, simply move them somewhere else, then move them back when complete.'
echo
echo
echo 'Warning: If you update to the latest version of apple operating system, your php base version may change.'
echo
echo 'For instance, Mojave is php 7.4 base. Brew will remove 7.3 on upgrade.'
echo 'This script creates symlinks within /usr/local/Cellar for your base php versions.'
echo
echo 'Meaning if you moved from 7.3 to 7.4, and used Launcher previously, you may have a symlink of php73 and [email protected], now pointing at 7.4.'
echo
echo 'Go into /usr/local/Cellar, or whatever your Cellar location is, and run: rm -rf php73 && rm -rf [email protected]'
echo
echo 'Afterwards you may then run: brew install [email protected] without issue.'
echo 'Your base php version will still be properly symlinked for Launcher to work with your base php version.'
echo
echo 'The end, tootles.'
echo
echo
echo 'This has been a message brought you by your friendly neighborhood developer.'

# Change updated variable to false
cd "${0%/*}" && sed -i '' 's/notification=true/notification=false/' '.updated'
exit 0
fi

0 comments on commit 0f7f037

Please sign in to comment.