mirror of
https://github.com/edu4rdshl/based.fish.git
synced 2026-07-17 23:24:46 +00:00
Initial commit
This commit is contained in:
commit
28f308e8a3
11 changed files with 240 additions and 0 deletions
17
functions/__based_init_db.fish
Normal file
17
functions/__based_init_db.fish
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
function __based_init_db
|
||||
set -l db_path ~/.local/share/fish/based/based.db
|
||||
if test -f $db_path
|
||||
echo "Database already exists at $db_path. If you want to reinitialize, please delete it first."
|
||||
return
|
||||
end
|
||||
mkdir -p (dirname $db_path)
|
||||
sqlite3 $db_path "CREATE TABLE IF NOT EXISTS log (
|
||||
path TEXT NOT NULL,
|
||||
cmd TEXT NOT NULL,
|
||||
counter INTEGER NOT NULL DEFAULT 1,
|
||||
ts INTEGER NOT NULL,
|
||||
PRIMARY KEY (path, cmd)
|
||||
);"
|
||||
|
||||
echo "Based initialized. You can also import your fish history with 'based import'."
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue