insert data only if folder missing

This commit is contained in:
q
2018-08-14 16:47:55 +03:00
parent 43c072fd6a
commit c7ef1fac7c

View File

@@ -33,10 +33,11 @@ _help() {
} }
_load_config(){ _load_config() {
STORAGE=${CCLIP_HOME:-~/.cache/cclip} STORAGE=${CCLIP_HOME:-~/.cache/cclip}
mkdir -p "$STORAGE" [[ -d "$STORAGE" ]] || {
[[ -e "$STORAGE"/0 ]] || { _msg "Creating $STORAGE folder, and inserting sample data"
mkdir -p "$STORAGE"
echo Sample data | _write_stdin 0 echo Sample data | _write_stdin 0
} }
} }