mirror of
https://github.com/lxsang/silk.git
synced 2024-12-25 12:38:21 +01:00
fix: Change default silk db path to /var/silk
All checks were successful
gitea-sync/silk/pipeline/head This commit looks good
All checks were successful
gitea-sync/silk/pipeline/head This commit looks good
This commit is contained in:
parent
bf5284e66f
commit
6380787d7e
@ -1,5 +1,5 @@
|
||||
# initialise autoconf and set up some basic information about the program we’re packaging
|
||||
AC_INIT([silk], [0.1.0], [xsang.le@gmail.com])
|
||||
AC_INIT([silk], [0.1.1], [xsang.le@gmail.com])
|
||||
|
||||
# We’re going to use automake for this project
|
||||
# [subdir-objects] if needed
|
||||
|
@ -4,7 +4,7 @@ math.randomseed(os.time())
|
||||
__api__ = {
|
||||
apiroot = string.format("%s/lua", _SERVER["LIB_DIR"]),
|
||||
tmpdir = _SERVER["TMP_DIR"],
|
||||
dbpath = _SERVER["DB_DIR"]
|
||||
dbpath = "/var/silk"
|
||||
}
|
||||
-- root dir
|
||||
__ROOT__ = _SERVER["DOCUMENT_ROOT"]
|
||||
|
@ -13,6 +13,13 @@ sqlite.getdb = function(name)
|
||||
LOG_ERROR("Invalid database name %s", name)
|
||||
return nil
|
||||
else
|
||||
-- default db path is /var/silk/
|
||||
if not ulib.exists(__api__.dbpath) then
|
||||
if not ulib.mkdir(__api__.dbpath) then
|
||||
LOG_ERROR("Unable to create DB path: %s", __api__.dbpath)
|
||||
return nil
|
||||
end
|
||||
end
|
||||
return sqlite.db(__api__.dbpath .. "/" .. name .. ".db")
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user