From e9926096a186791e30d094cf30585033c8943b60 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 10 May 2020 19:03:46 -0500 Subject: Enable licenser_source to be set by env --- licenser | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'licenser') diff --git a/licenser b/licenser index 7d710d3..2337470 100755 --- a/licenser +++ b/licenser @@ -7,7 +7,7 @@ # Constants ## where to download licenses from PRGN="${0##*/}" -LICENSER_SOURCE="https://git.sr.ht/~acdw/licenser-licenses/blob/master" +: "${LICENSER_SOURCE:=https://git.sr.ht/~acdw/licenser-licenses/blob/master}" LICENSER_CACHE="${XDG_DATA_HOME:-$HOME/.local/share}/licenser" LICENSER_LICENSE="${LICENSER_LICENSE:-MIT}" EXEC="${EXEC:-true}" @@ -16,12 +16,13 @@ usage() { cat < "$__OUT" + )" >"$__OUT" log "$__LICENSE written to $__OUT." } @@ -125,6 +130,8 @@ list_licenses() { cached="$LICENSER_CACHE/manifest" source="$LICENSER_SOURCE/manifest" + [ "x$1" = "x-r" ] && rm "$cached" + mkdir -p "$LICENSER_CACHE" log "Checking cache for manifest..." if [ ! -f "$cached" ]; then @@ -163,7 +170,7 @@ email() { if [ -z "$__EMAIL" ]; then __EMAIL="$(git config --get user.email)" # try from git fi - [ -n "$__EMAIL" ] && put "$__EMAIL" + [ -n "$__EMAIL" ] && put "<$__EMAIL>" } # helpers -- cgit 1.4.1-21-gabe81