Skip to content

Commit

Permalink
fix: Prefix SQLite database path
Browse files Browse the repository at this point in the history
  • Loading branch information
Griefed committed Dec 10, 2023
1 parent ccba8c0 commit 973cd28
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1187,10 +1187,13 @@ actual class ApiProperties(
@Suppress("MemberVisibilityCanBePrivate")
var jdbcDatabaseUrl: String = "jdbc:sqlite:serverpackcreator.db"
get() {
var dbPath = internalProps.getProperty(pSpringDatasourceUrl, "").replace("jdbc:sqlite:", "")
if (dbPath.isEmpty()) {
var dbPath = internalProps.getProperty(pSpringDatasourceUrl, "")
if (dbPath.replace("jdbc:sqlite:", "").isEmpty()) {
dbPath = "jdbc:sqlite:${File(homeDirectory, "serverpackcreator.db").absoluteFile}"
}
if (!dbPath.startsWith("jdbc:sqlite:")) {
dbPath = "jdbc:sqlite:$dbPath"
}
internalProps.setProperty(pSpringDatasourceUrl, dbPath)
field = dbPath
return field
Expand Down

0 comments on commit 973cd28

Please sign in to comment.