Repository navigation
fix(forge): name the application after the directory for create-app --inplace - #16985
borinquenkid wants to merge 2 commits into
Conversation
…-inplace create-app --inplace without a name stopped with 'Specify an application name or use --inplace', so the option could not be used alone. With --inplace and no name the application takes the name of the current directory. Fixes #14872 Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
jamesfredley
left a comment
There was a problem hiding this comment.
Not approving. An in-place create in a directory whose name has a dot uses only the last piece of that name.
| Project project; | ||
| try { | ||
| project = NameUtils.parse(name); | ||
| project = NameUtils.parse(resolveName()); |
There was a problem hiding this comment.
create-app --inplace from a directory named bookstore.demo, with no explicit name, should name the application bookstore.demo. The directory name is found, then parsed as a package, so the application is named demo. Use the directory name as the application name, and still honor a name given on the command.
…-app --inplace create-app --inplace without a name parsed the directory name as a package, so a directory named bookstore.demo gave the application the name demo. The directory name is now the application name as it is, the package is made from it as for a name without dots, and the class name treats the dot like a hyphen. A name given on the command is still parsed as before. Refs #14872 Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
|
Fixed in e22451f. With The package is made from the name as for a name without dots ( Cases: The new method throws for a directory name that is empty, If a directory name still gives the wrong application name, a failing spec or the directory name would show me which. |
✅ All tests passed ✅🏷️ Commit: e22451f Learn more about TestLens at testlens.app/docs. |
Draft: on hold. The forge and scripts functionality is being rewritten in #17114 (jdaugherty), so this change waits for it.
create-app --inplacewithout a name in the Forge CLI stopped with "Specify an application name or use --inplace to create an application in the current directory", so the option could not be used alone. With--inplaceand no name the application now takes the name of the current directory, as the earlier Grails CLI did; with a name it creates the application in the current directory as before.Verified locally: the new
CreateAppCommandSpecfeature fails without the change and passes with it, plus a feature for--inplacewith a name; all 11 features of the spec pass. Thecreate-appreference page says how the name is chosen.Fixes #14872
https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL