Is there a parameter to specify what version of Co...
# box-products
p
Is there a parameter to specify what version of Coldbox you want to use when using the
coldbox create app
to spin up a skeleton? Or does this only work with the latest version of cb?
b
@Patrick The version of COldBox is determined by the version of the template
HOwever, in previous versions, there wasn't a good correlation so it was confusing
A while back I think we started versioning our templates to match the major version of the coldbox version they included
So, for example, here is our default template https://github.com/coldbox-templates/default/releases
p
So I installed Coldbox 6.4 only into my dir. Then did
coldbox create app crap
and it upgraded my CB version to 7.1 or latest ver.
b
You can see the most recent versions are 7. and they include COldBox 7
If you go back about 4 versions, you can see there is
6.25.0
which was the last 6.x version of the template
Now, that said, it sounds like you're doing something odd. You should only eve run these scaffolding commands in an empty folder
They will completely overwrite any files you may already have there!
Also, each template takes care of installing ColdBOx, so there's no use case where you would first install coldbox and then run a scaffolding app command
p
so how do I do that create app scaffold to "set" that I want that 6.25.0...I actually looked at the templates on github but couldnt figure out how to force the version
b
I'm getting there...
The templates are all published to forgebox as packages
So you just specify the install ID in the same format you'd use with the install command.
Copy code
coldbox create app skeleton=cbtemplate-advanced-script@6
in an empty folder
And you'll get the latest version of our default template for ColdBox 6
p
Ahh so this is what I tried last night:
coldbox create app name=aaa skeleton=default@6.25.0
b
That was a good guess
p
yea wouldnt have guessed the cbtemplate name convention. Might want to add some detail to the docs about this
b
cbtemplate-advanced-script
has always been the true forgebox slug for that template. We just have a simple little lookup that allows you to have an alias for the common ones
But we've only done an exact check on those little convenience names https://github.com/ColdBox/coldbox-cli/blob/development/commands/coldbox/create/app.cfc#L98-L101
So as soon as you go "off road" and want a version, you'll need to use the actual forgebox slug
It would actually be pretty easy to make what you tried just work 🙂
p
yea I am just not ready to make the v7 shift just yet
b
Take the user inputted
skeleton
parameter and if
listFirst( skeleton, '@' )
is found in the struct, then grab the real forgebox slug and slap
listRest( skeleton, '@' )
on the end of it.
p
And yea I was also doing the assumption that having CB installed would allow the command to detect what version template to grab
b
The only real downside of our little lookup table is the means you can never use a forgebox package that actually matches one of those shortcuts
I would merge a pull request that does what I just described
👍🏻 1