From 2f6e28b08fb7b4c7ed1d33485b9a18f5a082ca68 Mon Sep 17 00:00:00 2001 From: joachimschmidt557 Date: Sun, 2 Feb 2020 20:38:49 +0100 Subject: [PATCH] wip src --- src | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src b/src index f837e7d..5c65e8a 100755 --- a/src +++ b/src @@ -63,17 +63,31 @@ update_tarfile() { fi } +update_zipfile() { + ## Download and extract this tarfile if it + ## doesn't exist yet + if ! [ -d "$2" ] ; then + wget "$1" + unzip "$1" -d "$2" + updated="$updated $2" + else + echo "Already downloaded" + fi +} + update_item() { ## Updates an individual item + echo "Updating: $3" case "$1" in "git") - echo "Updating: $3" update_gitrepo "$2" "$3" ;; "tar") - echo "Updating: $3" update_tarfile "$2" "$3" ;; + "zip") + update_zipfile "$2" "$3" + ;; *) echo "Not a valid source type: $1" errors="$errors $3" @@ -89,7 +103,7 @@ preproc() { fi tmp="$srcfile.tmp" - sed 's/^#.*//; /^\s*$/d' < "$srcfile" > "$tmp" + sed 's/\s*#.*$//; /^\s*$/d' < "$srcfile" > "$tmp" } cleanup() {