Skip to content

Commit

Permalink
Improve command error message when the app directory exists
Browse files Browse the repository at this point in the history
  • Loading branch information
rainboyan committed Jul 3, 2024
1 parent d99f785 commit a41827a
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit a41827a

Please sign in to comment.