[CommandBox] install directoy

I cannot seem to figure out how to get the directory argument for the install command to work? I would like to install CB4 into the directory “c:\dev\apps\coldbox-4.0.0” on Windows.

I’ve tried:

install coldbox-be --directory=c:\dev\apps\coldbox-4.0.0

and also every other version I can think of (quotes, fwd slashes, no drive letters, args before the slug name, etc.) but it always installs it in a folder named coldbox in the commandbox root folder?

I’d like to use commandbox to be able to install cb4 in with this dir structure:


How do I do this?


Why don’t you try to:

cd /dev/apps/
install coldbox-be

true, but: first, I still cannot get the folder naming convention (for having several different versions of coldbox) and second - I think the “directory” argument is there to do what I am trying to achieve but either it’s not working as advertised or (likely) I’m doing it wrong?

So basically what we have here is the fact that there’s a handful of different ways to install ColdBox and its difficult to cater to each of them. What CommandBox does with the directory parameter is that’s the base folder where it unpacks the ColdBox framework, but the framework zip file INCLUDES the “coldbox” folder so you can’t really get out of it having that name. Ideally, we wouldn’t have the “coldbox” folder in the zip file, but removing it would break ForgeBox’s backwards compatibility with other install methods like the the CF Builder Ext and people just wanting to do a manual install because those method just grab the same zip from ForgeBox and and unpack them in the web root.

So, if you want to get fancy and have multiple versions of ColdBox, you’ll have to do some manual steps (and CommandBox won’t be able to uninstall the package unless you also update the install location in your box.json.

So first, a couple of notes:

> install coldbox-be --directory=c:\dev\apps\coldbox-4.0.0

That syntax won’t work as you’re trying to use “directory” as a boolean flag. The “–” is reserved only for true/false parameters. Valid syntaxes would be:
install coldbox-be c:\dev\apps\coldbox-4.0.0
install slug=coldbox-be directory=c:\dev\apps\coldbox-4.0.0

More information can be found on CommandBox syntax in our docs here:

> it always installs it in a folder named coldbox in the commandbox root folder

Yes, that’s a little weird and undoubtedly due to the errant “–” that is probably setting the directory parameter to “true”.

So, since the ColdBox zip actually includes the “coldbox” folder in its root, you can use the mv command to rename the folder whatever you want.

// Change in to the root of your app
cd C:\dev\apps
// Install coldbox-be
install coldbox-be
// Rename the folder
mv coldbox coldbox-4.0.0
// OPTIONAL: update the install path
package set installpaths.coldbox-be=coldbox-4.0.0

Note, that last command will error if you don’t update to the bleeding edge as I just now fixed a bug in package properties that have a dash in them.



ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Thanks Brad! Huge help… honestly, I looked high and low for that docs link above re:parameters before posting, but found only the “Introduction” part. I think armed with that - and your response - I ought to be able to noodle through an automated solution…