From 3f87ea5a27b080756b3994674d842185e3e0c496 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 8 Jul 2013 20:57:47 -0600 Subject: librefetch: don't create modified files until after the help/version modes --- src/librefetch/librefetch | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 5428655..07303ae 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -66,16 +66,6 @@ main() { mode=download-create parse_options "$@" - local startdir=$PWD - export BUILDDIR="${BUILDFILE%/*}" - if [[ -f "${BUILDDIR}/SRCBUILD" ]]; then - BUILDFILE="${BUILDDIR}/SRCBUILD" - srcbuild="$(modified_srcbuild "$BUILDFILE")" - else - srcbuild="$(modified_pkgbuild "$BUILDFILE")" - fi - makepkg="$(modified_makepkg "$(which "${MAKEPKG:-makepkg}")")" - # Mode: version, help ################################################## if [[ $mode =~ version ]]; then @@ -87,6 +77,18 @@ main() { return 0 fi + ######################################################################## + + local startdir=$PWD + export BUILDDIR="${BUILDFILE%/*}" + if [[ -f "${BUILDDIR}/SRCBUILD" ]]; then + BUILDFILE="${BUILDDIR}/SRCBUILD" + srcbuild="$(modified_srcbuild "$BUILDFILE")" + else + srcbuild="$(modified_pkgbuild "$BUILDFILE")" + fi + makepkg="$(modified_makepkg "$(which "${MAKEPKG:-makepkg}")")" + # Mode: checksums ###################################################### if [[ $mode =~ checksums ]]; then -- cgit v1.2.3-54-g00ecf