diff options
Diffstat (limited to 'include/lib.sh')
-rwxr-xr-x | include/lib.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/lib.sh b/include/lib.sh index a329fa3f..3de05c24 100755 --- a/include/lib.sh +++ b/include/lib.sh @@ -41,6 +41,12 @@ setvars() done printf "%s\n" "${_setvars% }" } +chkvars() +{ + for var in $@; do + eval "[ -n "\${$var+x}" ] || \$err \"$var unset\"" + done +} eval "$(setvars "" xbmk_release tmpdir _nogit version board boarddir relname \ versiondate threads projectname projectsite aur_notice cfgsdir datadir)" @@ -112,7 +118,7 @@ versiondate_="$versiondate" [ ! -e ".git" ] || versiondate="$(git show --no-patch --no-notes \ --pretty='%ct' HEAD)" || versiondate="$versiondate_" for p in projectname version versiondate projectsite; do - eval "[ -n \"\$$p\" ] || $err \"$p unset\"" + chkvars "$p" eval "x_ printf \"%s\\n\" \"\$$p\" > $p" done relname="$projectname-$version" |