Commit 5e2ff569 by Sam Stephenson

fetch_git shows an error if git is not installed

parent 48590792
......@@ -116,8 +116,13 @@ fetch_git() {
local git_ref="$3"
echo "Cloning ${git_url}..." >&2
{ git clone --depth 1 --branch "$git_ref" "$git_url" "${package_name}"
} >&4 2>&1
if type git 2>/dev/null; then
git clone --depth 1 --branch "$git_ref" "$git_url" "${package_name}" >&4 2>&1
else
echo "error: please install \`git\` and try again" >&2
exit 1
fi
}
build_package() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment