Ensure all DIRs exist
authorSiraaj Khandkar <siraaj@khandkar.net>
Sat, 21 Nov 2020 22:30:24 +0000 (17:30 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Sat, 21 Nov 2020 22:30:24 +0000 (17:30 -0500)
home/lib/login_variables.sh

index 8d3c2e6..0f0fd28 100644 (file)
@@ -1,6 +1,8 @@
 export PATH=$HOME/bin:$HOME/.local/bin:$HOME/go/bin:/snap/bin:/sbin:/usr/sbin:$PATH
 export EDITOR=vim
 export VISUAL=$EDITOR
+
+### DIRs ###
 export DIR_GITHUB="${HOME}/arc/soft/src/repos/remote/github.com"
 export DIR_AUDIO="${HOME}/arc/aud"
 export DIR_VIDEO="${HOME}/arc/vid"
@@ -9,12 +11,15 @@ export DIR_YOUTUBE_AUDIO="${DIR_AUDIO}/youtube.com"
 export DIR_NOTES="$HOME/doc/notes"
 export DIR_LOG="$HOME/var/log"
 export DIR_LOG_MPD="$DIR_LOG/mpd"
+export DIR_NQ="$HOME/var/run/nq"
+
+# ensure all DIRs exist:
+env | grep ^DIR_ | awk -F= '{print $2}' | xargs -I% mkdir -p '%'
+
+### FILEs ###
 export FILE_LOG_MPD="$DIR_LOG_MPD/mpd.log"
 export FILE_VIDEO_CATALOG="$DIR_VIDEO/catalog"
 
-export NQDIR="$HOME/var/run/nq"
-mkdir -p "$NQDIR"
-
 # .Net Core
 #DOTNET_ROOT_path=$(which dotnet)
 #DOTNET_ROOT_realpath=$(realpath "$DOTNET_ROOT_path")
This page took 0.028714 seconds and 4 git commands to generate.