server: drift_home
already has a default (#61)
`||` on an exsiting string does nothing
This commit is contained in:
parent
1c2fef0ee4
commit
6a6a2a3496
1 changed files with 1 additions and 2 deletions
|
@ -7,8 +7,7 @@ import config from "./config"
|
||||||
// This does *not* support `~other_user/tmp` => `/home/other_user/tmp`.
|
// This does *not* support `~other_user/tmp` => `/home/other_user/tmp`.
|
||||||
function getDatabasePath() {
|
function getDatabasePath() {
|
||||||
const fileName = "drift.sqlite"
|
const fileName = "drift.sqlite"
|
||||||
const databasePath =
|
const databasePath = `${config.drift_home}/${fileName}`
|
||||||
`${config.drift_home}/${fileName}` || `~/.drift/${fileName}`
|
|
||||||
|
|
||||||
const home = os.homedir().replace("$", "$$$$")
|
const home = os.homedir().replace("$", "$$$$")
|
||||||
return path.resolve(databasePath.replace(/^~($|\/|\\)/, home + "$1"))
|
return path.resolve(databasePath.replace(/^~($|\/|\\)/, home + "$1"))
|
||||||
|
|
Loading…
Reference in a new issue