From a41827a736eea54ada50736319f1dfde42ee5ff6 Mon Sep 17 00:00:00 2001 From: Michael Yan Date: Wed, 3 Jul 2024 10:47:18 +0800 Subject: [PATCH] Improve command error message when the app directory exists --- .../org/grails/cli/profile/commands/CreateAppCommand.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grace-shell/src/main/groovy/org/grails/cli/profile/commands/CreateAppCommand.groovy b/grace-shell/src/main/groovy/org/grails/cli/profile/commands/CreateAppCommand.groovy index 464356ff32..4b5850b880 100644 --- a/grace-shell/src/main/groovy/org/grails/cli/profile/commands/CreateAppCommand.groovy +++ b/grace-shell/src/main/groovy/org/grails/cli/profile/commands/CreateAppCommand.groovy @@ -15,7 +15,6 @@ */ package org.grails.cli.profile.commands -import java.nio.file.DirectoryNotEmptyException import java.nio.file.FileVisitResult import java.nio.file.Files import java.nio.file.Path @@ -279,7 +278,7 @@ class CreateAppCommand extends ArgumentCompletingCommand implements ProfileRepos File projectTargetDirectory = cmd.inplace ? new File('.').canonicalFile : appFullDirectory.toAbsolutePath().normalize().toFile() if (projectTargetDirectory.exists() && !isDirectoryEmpty(projectTargetDirectory)) { - GrailsConsole.getInstance().error(new DirectoryNotEmptyException(projectTargetDirectory.absolutePath)) + GrailsConsole.getInstance().error("Directory `${projectTargetDirectory.absolutePath}` is not empty!") return false }