From 6f18ab183aa3fb0d48112c4f18b85abdcb60b75c Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Thu, 11 Sep 2014 10:40:47 -0400 Subject: [PATCH 1/3] `test -d` to make sure awscli is actually installed brew --prefix shows the location that a package is or would be installed: https://github.com/Homebrew/homebrew/blob/a8582c58/share/man/man1/brew.1#L448-L449 --- plugins/aws/aws.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 0ae18dd56..95ebc5b85 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -3,7 +3,7 @@ _homebrew-installed() { } _awscli-homebrew-installed() { - brew list awscli &> /dev/null + test -d brew --prefix awscli &> /dev/null } export AWS_HOME=~/.aws From 15384a8666234b2bb12ca7911d9c01e888154015 Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Tue, 30 Sep 2014 10:17:49 -0400 Subject: [PATCH 2/3] Use `test -d` correctly --- plugins/aws/aws.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 95ebc5b85..1aa56a347 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -3,7 +3,7 @@ _homebrew-installed() { } _awscli-homebrew-installed() { - test -d brew --prefix awscli &> /dev/null + test -d "$( brew --prefix awscli )" } export AWS_HOME=~/.aws From 66e700e44822577a8f644bec3673c90239634cb5 Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Tue, 30 Sep 2014 10:26:33 -0400 Subject: [PATCH 3/3] Rely on `which` to determine which awscli to use --- plugins/aws/aws.plugin.zsh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 1aa56a347..533eb8c71 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -1,11 +1,3 @@ -_homebrew-installed() { - type brew &> /dev/null -} - -_awscli-homebrew-installed() { - test -d "$( brew --prefix awscli )" -} - export AWS_HOME=~/.aws function agp {