|
|
@ -243,6 +243,21 @@ listEntries(){ |
|
|
|
sqlite3 --column $header "${sqliteFile}" |
|
|
|
sqlite3 --column $header "${sqliteFile}" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
indexFolder(){ |
|
|
|
|
|
|
|
vecho "indexFolder $*" |
|
|
|
|
|
|
|
local olddogit="$dogit" |
|
|
|
|
|
|
|
dogit=0 |
|
|
|
|
|
|
|
initDB |
|
|
|
|
|
|
|
find "$dataDir" -name "*.md" | while read file; do |
|
|
|
|
|
|
|
file="${file##*/}" |
|
|
|
|
|
|
|
updateFileChange "$file" |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
dogit="$olddogit" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mainScript() { |
|
|
|
mainScript() { |
|
|
|
############## Begin Script Here ################### |
|
|
|
############## Begin Script Here ################### |
|
|
|
#################################################### |
|
|
|
#################################################### |
|
|
@ -255,18 +270,20 @@ mainScript() { |
|
|
|
fi |
|
|
|
fi |
|
|
|
fi |
|
|
|
fi |
|
|
|
case "${args[0]}" in |
|
|
|
case "${args[0]}" in |
|
|
|
init) initKnowledgeBase; safeExit ;; |
|
|
|
deepsearch) deepSearch "${args[@]:1}"; safeExit ;; |
|
|
|
makedb) makedb; safeExit ;; |
|
|
|
del|delete) deleteFile "${args[@]:1}"; safeExit ;; |
|
|
|
new) newFile "${args[@]:1}"; safeExit ;; |
|
|
|
|
|
|
|
edit) editFile "${args[@]:1}"; safeExit ;; |
|
|
|
edit) editFile "${args[@]:1}"; safeExit ;; |
|
|
|
|
|
|
|
fuzzy) fuzzySelect "${args[@]:1}"; safeExit ;; |
|
|
|
|
|
|
|
git) externalgit "${args[@]:1}"; safeExit ;; |
|
|
|
|
|
|
|
index) indexFolder "${args[@]:1}"; safeExit ;; |
|
|
|
|
|
|
|
init) initKnowledgeBase; safeExit ;; |
|
|
|
list) listEntries "${args[@]:1}"; safeExit ;; |
|
|
|
list) listEntries "${args[@]:1}"; safeExit ;; |
|
|
|
list-tags) listTags "${args[@]:1}"; safeExit ;; |
|
|
|
list-tags) listTags "${args[@]:1}"; safeExit ;; |
|
|
|
view) viewFile "${args[@]:1}"; safeExit ;; |
|
|
|
makedb) makedb; safeExit ;; |
|
|
|
fuzzy) fuzzySelect "${args[@]:1}"; safeExit ;; |
|
|
|
new) newFile "${args[@]:1}"; safeExit ;; |
|
|
|
update) updateFileChange "${args[@]:1}"; safeExit ;; |
|
|
|
update) updateFileChange "${args[@]:1}"; safeExit ;; |
|
|
|
deepsearch) deepSearch "${args[@]:1}"; safeExit ;; |
|
|
|
view) viewFile "${args[@]:1}"; safeExit ;; |
|
|
|
del|delete) deleteFile "${args[@]:1}"; safeExit ;; |
|
|
|
|
|
|
|
git) externalgit "${args[@]:1}"; safeExit ;; |
|
|
|
|
|
|
|
*) usage >&2; safeExit ;; |
|
|
|
*) usage >&2; safeExit ;; |
|
|
|
esac |
|
|
|
esac |
|
|
|
|
|
|
|
|
|
|
@ -315,6 +332,7 @@ usage() { |
|
|
|
edit or view |
|
|
|
edit or view |
|
|
|
git [options] Run arbitary git commands on the kb repository |
|
|
|
git [options] Run arbitary git commands on the kb repository |
|
|
|
del [title] Delete a file |
|
|
|
del [title] Delete a file |
|
|
|
|
|
|
|
index Indexes the folder (usful after a clone etc) |
|
|
|
" |
|
|
|
" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|