Skip to content

Commit

Permalink
chore(direnv): use dir exists instead of brew list
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Nov 2, 2023
1 parent ee7acdd commit 6ea41d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ export AP_ROOT
dotenv
dotenv_if_exists dev.env

PATH_add "$AP_DEVCACHE_NODE_BIN"
PATH_add "$AP_DEVCACHE_BIN"

is_command() {
command -v "$1" >/dev/null
}
path="$AP_DEVCACHE_NODE_BIN:$AP_DEVCACHE_BIN"

if ! has make ; then
echo -e "\033[31mmake is not installed"; exit 1
Expand Down Expand Up @@ -63,16 +58,23 @@ if ! has readlink ; then
fi

if [[ "$OSTYPE" == "darwin"* ]]; then
if ! is_command brew; then
if ! has brew; then
echo -e "\033[31mhomebrew is not installed. visit https://brew.sh"
exit 1
fi

if ! brew list gnu-getopt >/dev/null 2>&1 ; then
if [[ -z $HOMEBREW_PREFIX ]]; then
HOMEBREW_PREFIX=$(brew --prefix)
fi

# don't use brew list, as it is utterly slow
getopt_bin=${HOMEBREW_PREFIX}/opt/gnu-getopt/bin

if [ ! -d "$getopt_bin" ]; then
echo -e "\033[31mgnu-getopt is not installed. to install \"brew install gnu-getopt\""
exit 1
else
PATH_add "$(brew --prefix)/opt/gnu-getopt/bin"
path=$path:"$getopt_bin"
fi
fi

Expand All @@ -81,6 +83,8 @@ if [[ -z "$GOPATH" ]]; then
export GOPATH
fi

PATH_add "$path"

PROVIDER_SERVICES=$AP_DEVCACHE_BIN/provider-services
AKASH=$AP_DEVCACHE_BIN/akash

Expand Down
1 change: 1 addition & 0 deletions cluster/kube/operators/deploy/deploy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package deploy

0 comments on commit 6ea41d2

Please sign in to comment.