Skip to content

Commit

Permalink
Refactor slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
qvacua committed Feb 14, 2020
1 parent 88593df commit f0dc193
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions bin/build_deps.sh
Expand Up @@ -17,6 +17,7 @@ readonly build_xz=${build_xz:-false}
readonly build_gettext=${build_gettext:-false}

build_ag () {
echo "### Building ag..."
pushd .deps > /dev/null
curl -L -o ag.tar.gz https://github.com/ggreer/the_silver_searcher/archive/${ag_version}.tar.gz
tar xf ag.tar.gz
Expand All @@ -41,9 +42,11 @@ pushd .deps > /dev/null
popd > /dev/null
popd > /dev/null
popd > /dev/null
echo "### Built ag."
}

build_xz () {
echo "### Building xz (and ag)..."
pushd .deps > /dev/null
curl -L -o xz.tar.gz https://tukaani.org/xz/xz-${xz_version}.tar.gz
tar xf xz.tar.gz
Expand All @@ -62,9 +65,11 @@ pushd .deps > /dev/null
rm -rf $(pwd)/../../third-party/libxz/share
popd > /dev/null
popd > /dev/null
echo "### Built xz (and ag)..."
}

build_pcre () {
echo "### Building pcre (and ag)..."
pushd .deps > /dev/null
curl -L -o pcre.tar.bz2 https://ftp.pcre.org/pub/pcre/pcre-${pcre_version}.tar.bz2
tar xf pcre.tar.bz2
Expand All @@ -89,6 +94,7 @@ pushd .deps > /dev/null
rm -rf $(pwd)/../../third-party/libpcre/share
popd > /dev/null
popd > /dev/null
echo "### Built pcre (and ag)..."
}

build_vimr_deps () {
Expand All @@ -97,15 +103,18 @@ mkdir .deps

if [[ ${build_pcre} == true ]] ; then
rm -rf third-party/libpcre
rm -rf third-party/libag

build_pcre

rm -rf third-party/libag
build_ag
fi

if [[ ${build_xz} == true ]] ; then
rm -rf third-party/libxz
build_xz

rm -rf third-party/libag
build_ag
fi

if [[ ${build_ag} == true ]] ; then
Expand Down Expand Up @@ -162,8 +171,12 @@ popd > /dev/null
echo "### Built deps"
}

main () {
if [[ ${build_gettext} == true ]] ; then
build_gettext
fi

build_vimr_deps
}

main

0 comments on commit f0dc193

Please sign in to comment.