This repository has been archived by the owner on Aug 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03ba55b
commit 73220af
Showing
6 changed files
with
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# 0.1.0 | ||
- add support for homebrew | ||
|
||
# 0.0.9 | ||
- fix testing for existing groups in user type | ||
|
||
|
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 +1 @@ | ||
0.0.9 | ||
0.1.0 |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bats | ||
|
||
. test/helpers.sh | ||
|
||
fn() { . $BOLT_DIR/types/brew.sh $*; } | ||
|
||
@test "brew status: returns MISSING if package is not present" { | ||
skip_darwin && skip_exec brew | ||
run fn status doesnotexist | ||
[ $status -eq $STATUS_MISSING ] | ||
} | ||
|
||
@test "brew install: installs the package" { | ||
skip_darwin && skip_exec brew | ||
brew remove hr | ||
run fn install hr | ||
[ $status -eq $STATUS_OK ] | ||
which hr | ||
[ $status -eq $STATUS_OK ] | ||
} | ||
|
||
@test "brew status: returns OK if package is present" { | ||
skip_darwin && skip_exec brew | ||
run fn status hr | ||
[ $status -eq $STATUS_OK ] | ||
} |
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,34 @@ | ||
# modified from original version at https://github.com/mattly/bork | ||
|
||
action=$1 | ||
name=$2 | ||
shift 2 | ||
|
||
case $action in | ||
desc) | ||
echo "assert package installed via homebrew on OSX" | ||
echo "> brew package" | ||
;; | ||
|
||
status) | ||
platform "Darwin" || return "$STATUS_UNSUPPORTED_PLATFORM" | ||
exec "ruby" || return "$STATUS_FAILED_PRECONDITION" | ||
|
||
echo "$(brew list)" | grep "^$name" | ||
[ "$?" -gt 0 ] && return "$STATUS_MISSING" | ||
|
||
brew outdated $name | ||
[ "$?" -ne 0 ] && return "$STATUS_OUTDATED" | ||
return "$STATUS_OK" | ||
;; | ||
|
||
install) | ||
brew install $name | ||
;; | ||
|
||
upgrade) | ||
brew upgrade $name | ||
;; | ||
|
||
*) return 1 ;; | ||
esac |