nixpkgs/pkgs/development/perl-modules/expression-generator/grab-url.sh
Victor Engmark 57b496ea98 misc: Replace tab indentation with spaces
I've tried to be consistent, using four or eight spaces to line up
with existing code.
2021-11-14 16:04:46 +13:00

20 lines
256 B
Bash
Executable File

#! /bin/sh
source lib-cache.sh
get_file() {
url="$1";
if [ -n "$url" ]; then
curl "$1";
else
echo -n;
fi;
}
url="$1";
name="$2";
name=${name:-$(basename "$url")}
cached_output get_file "${name%%.*}" "$url" "${name#*.}"