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`.
|
||||
function getDatabasePath() {
|
||||
const fileName = "drift.sqlite"
|
||||
const databasePath =
|
||||
`${config.drift_home}/${fileName}` || `~/.drift/${fileName}`
|
||||
const databasePath = `${config.drift_home}/${fileName}`
|
||||
|
||||
const home = os.homedir().replace("$", "$$$$")
|
||||
return path.resolve(databasePath.replace(/^~($|\/|\\)/, home + "$1"))
|
||||
|
|
Loading…
Add table
Reference in a new issue