Skip to content

Commit

Permalink
Merge pull request #1 from woopstar/patch-1
Browse files Browse the repository at this point in the history
Add new Homebrew path and fix security concern
  • Loading branch information
lhaeger authored May 21, 2021
2 parents b6f1df0 + 29eeb9f commit 2dbc453
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions workflow/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ tell application "Finder"
set lpass_binary to "/usr/local/bin/lpass"
else if exists POSIX file "/opt/local/bin/lpass" then
set lpass_binary to "/opt/local/bin/lpass"
else if exists POSIX file "/opt/homebrew/bin/lpass" then
set lpass_binary to "/opt/homebrew/bin/lpass"
end if
end tell
Expand All @@ -305,7 +307,7 @@ if ("{query}" = "scriptlocationnotset") then
display notification "Please wait... the alfred search will be presented once login is complete." with title "LastPass Login"
end if
do shell script "/bin/bash -c '" & "export TERM=\"xterm-256color\" && export LPASS_ASKPASS=\"" & osascript & "\" && export LPASS_AGENT_TIMEOUT=" & login_timeout & " && " & lpass_binary & " login --trust \"" & login_email & "\" && clear && " & lpass_binary & " ls --sync=now > /dev/null 2>&1 && exit 0'"
do shell script "/bin/bash -c '" & "export TERM=\"xterm-256color\" && export LPASS_ASKPASS=\"" & osascript & "\" && export LPASS_AGENT_TIMEOUT=" & login_timeout & " && " & lpass_binary & " login \"" & login_email & "\" && clear && " & lpass_binary & " ls --sync=now > /dev/null 2>&1 && exit 0'"
if ("{query}" = "scriptlocationnotset") then
tell application id "com.runningwithcrayons.Alfred" to search "lp "
Expand Down Expand Up @@ -407,7 +409,7 @@ exit 1;
} else {
my $lpass_exec;
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass@) {
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass /opt/homebrew/bin/lpass@) {
$lpass_exec = $f
if (-x $f);
}
Expand Down Expand Up @@ -530,7 +532,7 @@ my ($agent, $agentErr, $agentErrCode) = capture {
};
my $lpass_exec;
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass@) {
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass /opt/homebrew/bin/lpass@) {
$lpass_exec = $f
if (-x $f);
}
Expand Down Expand Up @@ -669,7 +671,7 @@ exit 1;
} else {
my $lpass_exec;
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass@) {
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass /opt/homebrew/bin/lpass@) {
$lpass_exec = $f
if (-x $f);
}
Expand Down Expand Up @@ -768,7 +770,7 @@ print $results;
<integer>127</integer>
<key>script</key>
<string>#!/bin/bash
for f in lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass; do
for f in lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass /opt/homebrew/bin/lpass; do
if test -x $f; then
lpass_exec=$f
fi
Expand Down Expand Up @@ -827,7 +829,7 @@ my ($agent, $agentErr, $agentErrCode) = capture {
};
my $lpass_exec;
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass@) {
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass /opt/homebrew/bin/lpass@) {
$lpass_exec = $f
if (-x $f);
}
Expand Down

0 comments on commit 2dbc453

Please sign in to comment.