Skip to content

Commit f88cb7c

Browse files
authored
Merge pull request #681 from marklogic/feature/634-module-timestamps
DEVEXP-634 Fixed deletion of module timestamps file
2 parents ec34a0f + 0e2a73f commit f88cb7c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/main/groovy/com/marklogic/gradle/task/DeleteModuleTimestampsFileTask.groovy

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ class DeleteModuleTimestampsFileTask extends MarkLogicTask {
2828
@TaskAction
2929
void deleteFile() {
3030
filePath = getAppConfig().getModuleTimestampsPath()
31-
File f = new File(filePath)
32-
if (f.exists()) {
33-
println "Deleting " + f.getAbsolutePath() + "\n"
34-
f.delete()
35-
} else {
36-
println "Module timestamps file " + filePath + " does not exist, so not deleting"
37-
}
31+
if (filePath != null && filePath.trim().length() > 0) {
32+
File f = new File(filePath)
33+
if (f.exists()) {
34+
println "Deleting " + f.getAbsolutePath() + "\n"
35+
f.delete()
36+
} else {
37+
println "Module timestamps file " + filePath + " does not exist, so not deleting"
38+
}
39+
} else {
40+
println "Module timestamps file path is not set, so not attempting to delete"
41+
}
3842
}
3943
}

0 commit comments

Comments
 (0)