Skip to content

Commit

Permalink
update distr- scripts with logdir
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 94bb33cdbddce12acdeaf9eacfcf1ecf38ac749065fbcfe570b95f26c4d46f34
  • Loading branch information
letoram committed Aug 18, 2018
1 parent 669ce43 commit 2f55885
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions distr/durden
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ fi
arcan_applbase=$arcan_base/appl
arcan_applout=$arcan_base/appl-out
arcan_resources=$arcan_base/resources
arcan_logpath=$arcan_base/logs

# a dev would've overridden this one
if [ ! -d "$arcan_applbase/$applname" ]; then
Expand Down Expand Up @@ -70,6 +71,11 @@ if [ ! -z "${XDG_VIDEOS_DIR}" ] && [ ! -d "${arcan_resources}/Videos" ]; then
ln -s "${XDG_VIDEOS_DIR}" "${arcan_resources}/Videos"
fi

# this is opt-in, user must make this directory himself as it can get quite verbose
if [ -d "${arcan_logpath}" ]; then
export ARCAN_LOGPATH=${1:-$arcan_logpath}
fi

# setup namespace mapping
export ARCAN_APPLBASEPATH=${1:-$arcan_applbase}
export ARCAN_APPLSTOREPATH=${1:-$arcan_applout}
Expand All @@ -90,9 +96,17 @@ fi
# snap due to the possibility of sensitive data)
while true; do
starttime=$(date +%s)
if arcan ${distargs} -b "$applname" "$applname" "$@"; then
exit

if [ -d "${arcan_logpath}" ]; then
if arcan ${distargs} -b "$applname" "$applname" "$@" >"${arcan_logpath}/${applname}_${starttime}.log" 2>&1; then
exit
fi
else
if arcan ${distargs} -b "$applname" "$applname" "$@"; then
exit
fi
fi

stoptime=$(date +%s)
elapsed=$((stoptime - starttime))
if [ $elapsed -lt 10 ]; then
Expand Down

0 comments on commit 2f55885

Please sign in to comment.