cmd/--repository: fix homebrew- prefix handling
This commit is contained in:
parent
e44adc2c50
commit
38987be01f
@ -25,7 +25,7 @@ tap_path() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
repo="${repo#(home|linux)brew-}"
|
repo="${repo#@(home|linux)brew-}"
|
||||||
echo "${HOMEBREW_LIBRARY}/Taps/${user}/homebrew-${repo}"
|
echo "${HOMEBREW_LIBRARY}/Taps/${user}/homebrew-${repo}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,8 +38,11 @@ homebrew---repository() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for tap in "$@"
|
(
|
||||||
do
|
shopt -s extglob
|
||||||
tap_path "${tap}"
|
for tap in "$@"
|
||||||
done
|
do
|
||||||
|
tap_path "${tap}"
|
||||||
|
done
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,4 +14,11 @@ RSpec.describe "brew --repository", type: :system do
|
|||||||
.and not_to_output.to_stderr
|
.and not_to_output.to_stderr
|
||||||
.and be_a_success
|
.and be_a_success
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "prints a Tap's repository correctly when homebrew- prefix is supplied", :integration_test do
|
||||||
|
expect { brew_sh "--repository", "foo/homebrew-bar" }
|
||||||
|
.to output("#{ENV.fetch("HOMEBREW_LIBRARY")}/Taps/foo/homebrew-bar\n").to_stdout
|
||||||
|
.and not_to_output.to_stderr
|
||||||
|
.and be_a_success
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user