ColdBox / coldbox-cli

The official ColdBox CLI for CommandBox
https://www.coldbox.org
3 stars 4 forks source link

create orm-crud fails #12

Open gavinbaumanis opened 2 days ago

gavinbaumanis commented 2 days ago

What are the steps to reproduce this issue?

Follow the instructions at; https://coldbox.ortusbooks.com/the-basics/models/coding-orm-scaffolding

When running the following command: coldbox create orm-crud entity=models.Contacts pluralName=Contacts

This is outputted to the console:

INFO Created Model: [C:\Users\gavin\Workspace\coldbox_playground_scaffolding\models\/Contacts.cfc]

The file 'ContactsTest.cfc' already exists, overwrite it (y/n)? : y Resource Opened! INFO Created Test: [C:\Users\gavin\Workspace\coldbox_playground_scaffolding\tests\specs\unit\/ContactsTest.cfc]

Resource Opened! CommandBox:coldbox_playground_scaffolding> coldbox create orm-crud entity=models.Contacts pluralName=Contacts INFO Generated Handler: [C:\Users\gavin\Workspace\coldbox_playground_scaffolding\handlers\/Contacts.cfc]

INFO Generated View: [C:\Users\gavin\Workspace\coldbox_playground_scaffolding\views\/Contacts/edit.cfm]

INFO Generated View: [C:\Users\gavin\Workspace\coldbox_playground_scaffolding\views\/Contacts/editor.cfm]

INFO Generated View: [C:\Users\gavin\Workspace\coldbox_playground_scaffolding\views\/Contacts/new.cfm]

Then this error message follows:

ERROR (6.1.0-rc+00808)

Page /commandbox/modules/coldbox-cli/commands/coldbox/create/C:/Users/gavin/.CommandBox/cfml/modules/coldbox-cli/templates/crud/table.cfm [C:\Users\gavin.CommandBox\cfml\modules\coldbox-cli\commands\coldbox\create\C:\Users\gavin.CommandBox\cfml\modules\coldbox-cli\templates\crud\table.cfm] not found

\modules\coldbox-cli\commands\coldbox\create\orm-crud.cfc: line 135 133:          // Build table output for index 134:          savecontent variable="local.tableData" { 135:             include "#variables.settings.templatesPath#/crud/table.cfm"; 136:          } 137:          tableData = replaceNoCase( called from \system\services\CommandService.cfc: line 443 called from \system\services\CommandService.cfc: line 225 called from \system\Shell.cfc: line 865 called from \system\Shell.cfc: line 680 called from \system\Bootstrap.cfm: line 165

What were you expecting to happen?

No error should be thrown!

What versions are you using?

Operating System: … Windows 11 - latest

Package Version: … CommandBox Version: 6.1.0-rc+00808

System Modules coldbox-cli@^7.5.0+11

Application modules testbox@6.0.0+8 /testbox coldbox@7.3.0+16 /coldbox cbproxies@1.3.0+3 /coldbox/system/async/cbproxies globber@3.1.5 /testbox/system/modules/globber mockdatacfc@3.7.0+1 /testbox/system/modules/mockdatacfc cbstreams@2.0.1+12 /testbox/system/modules/cbstreams cbproxies@1.3.0+3 /testbox/system/modules/cbstreams/modules/cbproxies

gavinbaumanis commented 8 hours ago

This is a "Windows" issue only and is caused by the dynamic nature of the way directories are found / created.

The command: coldbox create orm-crud entity=models.Contacts pluralName=Contacts Works fine from Linux.

For a workaround on Windows - you can use the Windows Sub-system for Linux (WSL)