Skip to content

Commit c57c54c

Browse files
committed
GRAILS-10266 create the history file if it doesn't exist
1 parent 05a8de9 commit c57c54c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java

+8
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ protected Terminal createTerminal() {
196196
*/
197197
protected History prepareHistory() throws IOException {
198198
File file = new File(System.getProperty("user.home"), HISTORYFILE);
199+
if (!file.exists()) {
200+
try {
201+
file.createNewFile();
202+
}
203+
catch (IOException ignored) {
204+
// can't create the file, so no history for you
205+
}
206+
}
199207
return file.canWrite() ? new History(file) : null;
200208
}
201209

0 commit comments

Comments
 (0)