Fixed exclude file being null not handled
This commit is contained in:
parent
1cf1eca45f
commit
e7a557c305
@ -29,20 +29,22 @@ class GetIgnoreRulesUseCase @Inject constructor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (baseConfig != null) {
|
if (baseConfig != null) {
|
||||||
var excludesFilePath = baseConfig.getString("core", null, "excludesFile")
|
var excludesFilePath = baseConfig.getString("core", null, "excludesFile") ?: ""
|
||||||
|
|
||||||
if (excludesFilePath.startsWith("~")) {
|
if (excludesFilePath.isNotEmpty()) {
|
||||||
excludesFilePath = excludesFilePath.replace("~", System.getProperty("user.home").orEmpty())
|
if (excludesFilePath.startsWith("~")) {
|
||||||
}
|
excludesFilePath = excludesFilePath.replace("~", System.getProperty("user.home").orEmpty())
|
||||||
|
}
|
||||||
|
|
||||||
val excludesFile = FileSystems
|
val excludesFile = FileSystems
|
||||||
.getDefault()
|
.getDefault()
|
||||||
.getPath(excludesFilePath)
|
.getPath(excludesFilePath)
|
||||||
.normalize()
|
.normalize()
|
||||||
.toFile()
|
.toFile()
|
||||||
|
|
||||||
if (excludesFile.exists() && excludesFile.isFile) {
|
if (excludesFile.exists() && excludesFile.isFile) {
|
||||||
ignoreLines.addAll(excludesFile.readLines())
|
ignoreLines.addAll(excludesFile.readLines())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user