Check if snippet dir exists and create first snippet
This commit is contained in:
parent
59fa862a8f
commit
68344d6643
11
snippy
11
snippy
@ -136,6 +136,15 @@ move_cursor() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init() {
|
||||||
|
# Check
|
||||||
|
if [[ ! -d "$snippets_directory" ]]; then
|
||||||
|
mkdir -p "$snippets_directory"
|
||||||
|
echo "$snippets_directory created"
|
||||||
|
echo "hi it is \$(date)" > "$snippets_directory/test"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
run() {
|
run() {
|
||||||
cd "${snippets_directory}" || exit
|
cd "${snippets_directory}" || exit
|
||||||
|
|
||||||
@ -267,4 +276,4 @@ run() {
|
|||||||
echo -ne "$current_clipboard" | xsel --clipboard --input
|
echo -ne "$current_clipboard" | xsel --clipboard --input
|
||||||
}
|
}
|
||||||
|
|
||||||
run
|
init && run
|
||||||
|
Loading…
Reference in New Issue
Block a user