fix: improve install.sh and init.lua
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
local M = {}
|
||||
local dict = require("Trans").dict
|
||||
local dict = require("Trans").db:open(M.conf.db_path)
|
||||
|
||||
function M.query(arg)
|
||||
-- TODO: return type: a result table:
|
||||
|
@@ -15,7 +15,16 @@ function M.setup(conf)
|
||||
require("Trans.setup")
|
||||
end
|
||||
|
||||
M.db = require("sqlite.db")
|
||||
M.dict = M.db:open(M.conf.db_path)
|
||||
local res = vim.fn.executable('sqlite3')
|
||||
if res ~= 1 then
|
||||
error('Please check out sqlite3')
|
||||
end
|
||||
|
||||
local status, db = pcall(require, 'sqlite.db')
|
||||
if not status then
|
||||
error('Please check out sqlite.lua')
|
||||
end
|
||||
|
||||
M.db = db
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user