aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2016-07-21 18:43:31 -0400
committerTeddy Wing2016-07-21 18:45:34 -0400
commit260882fdaf5441140469a35ec954818b7b1100b2 (patch)
tree278749ff551c02a30e6b9d477f345ae30cd708c6
parent70fc8f255abee76abd646ff6dd8c7b1cd87f264e (diff)
downloadqcd-260882fdaf5441140469a35ec954818b7b1100b2.tar.bz2
qcd: Add `setup` function
Should be run before accessing the database to set up configuration directories necessary for the command to work. Right now I'm not using the default directories, instead overriding the `QCD_DATABASE_FILE` variable on the shell for a custom database location. Haven't tested this yet, but figured I'd commit it and get back to it later.
-rwxr-xr-xqcd6
1 files changed, 6 insertions, 0 deletions
diff --git a/qcd b/qcd
index a4ee215..1b0cd3d 100755
--- a/qcd
+++ b/qcd
@@ -22,6 +22,10 @@ Usage:
__EOF__
}
+function setup () {
+ mkdir -p $QCD_CONFIG_DIR
+}
+
function absolute_path () {
(cd "$(dirname '$1')" &>/dev/null && printf "%s/%s" "$PWD" "${1##*/}")
}
@@ -32,6 +36,8 @@ function qcd () {
return
fi
+ # setup
+
local command=$1
case $command in