-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
homebrew support add homebrew instructions on install section change self-update to check for homebrew instalation and give proper instructions Co-authored-by: Leo Cavalcante <lc@leocavalcante.com>
- Loading branch information
1 parent
f521b0e
commit 6b2aa1f
Showing
2 changed files
with
24 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
is_brew_installed() { | ||
command -v brew >/dev/null 2>&1 | ||
} | ||
|
||
is_tap_installed() { | ||
local tap_name="$1" | ||
brew tap | grep -q "^$tap_name$" | ||
} | ||
|
||
self-update() { | ||
local tap_to_check="opencodeco/phpctl" | ||
local full_tap_pkg="$tap_to_check/phpctl" | ||
|
||
if is_brew_installed && is_tap_installed "$tap_to_check"; then | ||
echo -e "\033[32mSeems phpctl was installed by Homebrew, to update it run\033[0m brew upgrade $full_tap_pkg" | ||
else | ||
echo -e "Heading to \033[33m$PHPCTL_DIR\033[0m to update..." | ||
cd "$PHPCTL_DIR" || exit 1 | ||
git pull origin HEAD | ||
echo -e "\033[32mUpdated!\033[0m" | ||
fi | ||
} |