Add folder check before touch db

This commit is contained in:
Uğur Özyılmazel 2020-11-15 00:40:25 +03:00
parent e5baca394f
commit ba1b0a9452
No known key found for this signature in database
GPG Key ID: D0972B1BBE84BBE4

View File

@ -77,6 +77,10 @@ _goto_resolve_db()
{ {
local CONFIG_DEFAULT="${XDG_CONFIG_HOME:-$HOME/.config}/goto" local CONFIG_DEFAULT="${XDG_CONFIG_HOME:-$HOME/.config}/goto"
GOTO_DB="${GOTO_DB:-$CONFIG_DEFAULT}" GOTO_DB="${GOTO_DB:-$CONFIG_DEFAULT}"
GOTO_DB_CONFIG_DIRNAME=$(dirname "$GOTO_DB")
if [[ ! -d "$GOTO_DB_CONFIG_DIRNAME" ]]; then
mkdir "$GOTO_DB_CONFIG_DIRNAME"
fi
touch -a "$GOTO_DB" touch -a "$GOTO_DB"
} }