Skip to content

Commit

Permalink
Improve create-app command: display project informations after proj…
Browse files Browse the repository at this point in the history
…ect created

Closes gh-414
  • Loading branch information
rainboyan committed Jul 25, 2024
1 parent a41827a commit 2105fab
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import static org.grails.build.parsing.CommandLine.VERBOSE_ARGUMENT
*
* @author Graeme Rocher
* @author Lari Hotari
* @author Michael Yan
* @since 3.0
*/
@CompileStatic
Expand Down Expand Up @@ -282,6 +283,19 @@ class CreateAppCommand extends ArgumentCompletingCommand implements ProfileRepos
return false
}

String projectType = getName().substring(7)

cmd.console.addStatus("Creating a new ${projectType == 'app' ? 'application' : projectType}")
cmd.console.println()
cmd.console.println(" Name:".padRight(20) + appname)
cmd.console.println(" Package:".padRight(20) + defaultpackagename)
cmd.console.println(" Profile:".padRight(20) + profileName)
if (features) {
cmd.console.println(" Features:".padRight(20) + features*.name?.sort()?.join(', '))
}
cmd.console.println(" Project root:".padRight(20) + projectTargetDirectory.absolutePath)
cmd.console.println()

List<Profile> profiles = profileRepository.getProfileAndDependencies(profileInstance)

Map<Profile, File> targetDirs = [:]
Expand Down Expand Up @@ -337,9 +351,9 @@ class CreateAppCommand extends ArgumentCompletingCommand implements ProfileRepos
}

replaceBuildTokens(profileName, profileInstance, features, projectTargetDirectory)
cmd.console.addStatus(
"${name == 'create-plugin' ? 'Plugin' : 'Application'} created at ${projectTargetDirectory.absolutePath}"
)

cmd.console.addStatus("${projectType == 'app' ? 'Application' : projectType.capitalize()} created by Grace ${cmd.grailsVersion}.")

if (profileInstance.instructions) {
cmd.console.addStatus(profileInstance.instructions)
}
Expand Down

0 comments on commit 2105fab

Please sign in to comment.