From: Felix Kästner <4948415+fpunktk@users.noreply.github.com>
Date: Fri, 18 Feb 2022 14:37:56 +0000 (+0100)
Subject: use /tmp if $HOME is not set
X-Git-Url: https://fpunktk.de/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmain;p=travelrc.git

use /tmp if $HOME is not set
---

diff --git a/README.md b/README.md
index db7dc5d..e04b320 100644
--- a/README.md
+++ b/README.md
@@ -74,7 +74,7 @@ trccmd() {
     [ ${#trcvar} -lt 65536 ] || { echo "ERROR: content of trcdir '$trcdir' is too big, even after minifying and compressing with '$*'" >&2; return 1; }
     # export $TRAVELRCDIR and create this directory, it could also be created in /tmp
     echo '
-export TRAVELRCDIR=$HOME/.travelrc.travelled
+export TRAVELRCDIR=${HOME:-/tmp}/.travelrc.travelled
 readonly TRAVELRCDIR
 mkdir --parents $TRAVELRCDIR'
     # SSH_TTY should still be set to figure out whether this is a ssh session