|
|
|
@ -243,6 +243,21 @@ listEntries(){ |
|
|
|
|
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() { |
|
|
|
|
############## Begin Script Here ################### |
|
|
|
|
#################################################### |
|
|
|
@ -255,18 +270,20 @@ mainScript() { |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
case "${args[0]}" in |
|
|
|
|
init) initKnowledgeBase; safeExit ;; |
|
|
|
|
makedb) makedb; safeExit ;; |
|
|
|
|
new) newFile "${args[@]:1}"; safeExit ;; |
|
|
|
|
deepsearch) deepSearch "${args[@]:1}"; safeExit ;; |
|
|
|
|
del|delete) deleteFile "${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-tags) listTags "${args[@]:1}"; safeExit ;; |
|
|
|
|
view) viewFile "${args[@]:1}"; safeExit ;; |
|
|
|
|
fuzzy) fuzzySelect "${args[@]:1}"; safeExit ;; |
|
|
|
|
makedb) makedb; safeExit ;; |
|
|
|
|
new) newFile "${args[@]:1}"; safeExit ;; |
|
|
|
|
update) updateFileChange "${args[@]:1}"; safeExit ;; |
|
|
|
|
deepsearch) deepSearch "${args[@]:1}"; safeExit ;; |
|
|
|
|
del|delete) deleteFile "${args[@]:1}"; safeExit ;; |
|
|
|
|
git) externalgit "${args[@]:1}"; safeExit ;; |
|
|
|
|
view) viewFile "${args[@]:1}"; safeExit ;; |
|
|
|
|
|
|
|
|
|
*) usage >&2; safeExit ;; |
|
|
|
|
esac |
|
|
|
|
|
|
|
|
@ -315,6 +332,7 @@ usage() { |
|
|
|
|
edit or view |
|
|
|
|
git [options] Run arbitary git commands on the kb repository |
|
|
|
|
del [title] Delete a file |
|
|
|
|
index Indexes the folder (usful after a clone etc) |
|
|
|
|
" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|