From 78f1716450cec6163bcf4af3c066f8b9ac281cdf Mon Sep 17 00:00:00 2001 From: tokiclover Date: Tue, 30 Sep 2014 10:24:55 +0200 Subject: [PATCH] modules: firefox-profile: fhp: minor clean up/removed duplicated code --- modules/firefox-profile/functions/fhp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/firefox-profile/functions/fhp b/modules/firefox-profile/functions/fhp index 8ba3cd21..401fbeff 100644 --- a/modules/firefox-profile/functions/fhp +++ b/modules/firefox-profile/functions/fhp @@ -5,7 +5,7 @@ # $Header: firefox-profile/functions/fhp Exp $ # $Aythor: (c) 2011-2014 -tclover Exp $ # $License: MIT (or 2-clause/new/simplified BSD) Exp $ -# $Version: 3.0 2014/09/25 21:09:26 Exp $ +# $Version: 3.0 2014/09/30 Exp $ # function die { @@ -35,20 +35,24 @@ if [[ -f $profile/.unpacked ]] { tar -X $profile/.unpacked -Ocp $profile | $=compressor $profile$ext (( $? )) && die "failed to repack a new tarball" + popd -q return } compressor=$compressor[(w)1] if [[ -f $profile$ext ]] { - $compressor -cd $profile$ext | tar -xp && touch $profile/.unpacked - (( $? )) && die "failed to unpack the profile" + local tarball=$profile$ext } elif [[ -f $profile.old$ext ]] { - $compressor -cd $profile.old$ext | tar -xp && touch $profile/.unpacked - (( $? )) && die "failed to unpack the profile" + local tarball=$profile.old$ext } else { die "no tarball found" + return } + +$compressor -cd $tarball | tar -xp && touch $profile/.unpacked +(( $? )) && die "failed to unpack the profile" + popd -q #