Skip to content

Commit

Permalink
Merge pull request #138 from AthennaIO/develop
Browse files Browse the repository at this point in the history
chore(configurer): resolve relative path of database
  • Loading branch information
jlenon7 authored Jan 13, 2024
2 parents f041674 + 10229f3 commit 3ff631a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion configurer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* file that was distributed with this source code.
*/

import { relative } from 'node:path'
import { BaseConfigurer } from '@athenna/artisan'
import { File, Module, Parser, Path } from '@athenna/common'

Expand Down Expand Up @@ -96,7 +97,7 @@ export default class DatabaseConfigurer extends BaseConfigurer {
envs =
'\nDB_CONNECTION=sqlite\n' +
'DB_DEBUG=false\n' +
'DB_FILENAME=./database/sqlite.db\n'
`DB_FILENAME=${this.databasePath()}/sqlite.db\n`
break
default:
// eslint-disable-next-line no-case-declarations
Expand Down Expand Up @@ -177,4 +178,8 @@ export default class DatabaseConfigurer extends BaseConfigurer {

instruction.render()
}

private databasePath() {
return relative(Path.pwd(), Path.database().replace(/\\/g, '/'))
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/database",
"version": "4.30.0",
"version": "4.31.0",
"description": "The Athenna database handler for SQL/NoSQL.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down

0 comments on commit 3ff631a

Please sign in to comment.