dot

packages and services management
Log | Files | Refs | README

commit 9bbadeb40e8a13eb1d32fd931e7624947612319a
parent 8ec868a72260bd0b0b49acab007d8f5e85f7eb35
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed, 29 Nov 2017 17:47:47 +0100

use exec to replace if / elif / else

Diffstat:
Mbin/package | 9+++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/bin/package b/bin/package @@ -31,12 +31,9 @@ case "$1" in (get) mkdir -p "$HOME/.local/src" - if [ -f "$PKG/tar" ] - then "$0" tar "$2" && exit 0 - elif [ -f "$PKG/git" ] - then "$0" git "$2" && exit 0 - else exit 1 - fi + [ -f "$PKG/tar" ] && exec "$0" tar "$2" && exit 0 + [ -f "$PKG/git" ] && exec "$0" git "$2" && exit 0 + exit 1 ;; (build) [ -d "$SRC" ] || "$0" get "$2" || exit 1