kiss: Fix HOME unset and other minor issues

This commit is contained in:
Dylan Araps 2020-09-11 20:07:03 +03:00
parent 084d9f583f
commit 3d670da1f4
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

18
kiss
View File

@ -1636,15 +1636,15 @@ main() {
# do nothing on a normal system.
mkdir -p "$KISS_ROOT/" 2>/dev/null ||:
# Create the required temporary directories and set the variables which
# point to them.
mkdir -p "${cac_dir:=${XDG_CACHE_HOME:-$HOME/.cache}/kiss}" \
"${mak_dir:=${KISS_TMPDIR:=$cac_dir}/build-$pid}" \
"${pkg_dir:=${KISS_TMPDIR:=$cac_dir}/pkg-$pid}" \
"${tar_dir:=${KISS_TMPDIR:=$cac_dir}/extract-$pid}" \
"${src_dir:=$cac_dir/sources}" \
"${log_dir:=$cac_dir/logs}" \
"${bin_dir:=$cac_dir/bin}"
# Create cache directories and define variables.
mkdir -p \
"${cac_dir:="${XDG_CACHE_HOME:-"${HOME:?HOME is null}/.cache"}/kiss"}" \
"${mak_dir:="${KISS_TMPDIR:="$cac_dir"}/build-$pid"}" \
"${pkg_dir:="${KISS_TMPDIR:="$cac_dir"}/pkg-$pid"}" \
"${tar_dir:="${KISS_TMPDIR:="$cac_dir"}/extract-$pid"}" \
"${src_dir:="$cac_dir/sources"}" \
"${log_dir:="$cac_dir/logs"}" \
"${bin_dir:="$cac_dir/bin"}"
args "$@"
}