FZF exits with a status of 1 if nothing was selected. This is often the
case though if we are creating a new file so I added `|| true` to make
bash continue anyway
Instead of using $1 for file names, $* is used which results in spaces
being allowed without quoting.
This is in line with how the new command works.
As an example, it means the command
```
kb edit this is a test
```
will try and edit a file with the title "this is a test" rather than
"this"
The first bug output an error if trying to stage the deletion of the
yaml file if the file never existed. The error is now piped to /dev/null
and `|| true` is appended to the line which causes the script to carry
on execution
The second change is when deleting a file, you no longer have to quote
the file name if it is a multi word file. This puts it in line with the
new command
Work on #16
This was a relatively large amount of work. It introduces assets which
are stored in the assets sub directory and stored in the database with
the asset type in the database.
Due to bat also reading the $PAGER environment variable, I first look to
see if bat is available. If it is, I use that. If it isn't, I use the
$PAGER environment variable. If that's not available, I use cat.
I also added the --editor flag to the help output which had clearly been
missed
Close#12
This can be used when a file is modified externally. It will update the
sqlite database and potentially run git commands for the change.
If there are 2 files provided, it assumes that the file was moved. The
first filename should be the old file.
The new, edit and delete functions were also re factored slightly to use
this new update function.
Relevant to #4Close#2Close#1
This will list the tags along with the number of number of times it is
used.
An optional --noheader flag can be passed after the command to prevent
the header being printed.
e.g.
```
$ kb list-tags
name count
---------------- -----
Linux 2
Authentication 1
Pentesting 1
Enumeration 3
Network Protocol 2
```
```
$ kb list-tags --noheader
Linux 2
Authentication 1
Pentesting 1
Enumeration 3
Network Protocol 2
```
This --noheader flag was also added to the list command
Close#10
Currently Working:
* creating files
* deleting files
* editing files
* viewing files
* searching by id
* git
- Initialises repository
- commits when a file is created or edited (except rename)
- arbitrary git commands on repo with `kb git ....`
* sql
- Database is kept up to date when files are added, deleted or
edited
TODO:
* Recreate database if deleted or freshly cloned
* Add database to gitignore if not in normal location
* Update database if edited without this tool
* Create a git commit if files are deleted or renamed
* makefile for install and test (currently just surecheck)