Hi folks, long-time CF/web guy but quite new to CommandBox, apologies in advance for the silly questions, more to come…
Is it possible to move my CommandBox install, without losing history, dependencies, etc?
Hi folks, long-time CF/web guy but quite new to CommandBox, apologies in advance for the silly questions, more to come…
Is it possible to move my CommandBox install, without losing history, dependencies, etc?
Where do you want to move it to? You can grab the entire folder in your user’s home directory called “.CommandBox”. Specifically the artifacts folder inside has all your downloads.
Thanks!
~Brad
ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Sorry I wasn’t more specific. Just want to move box.exe.
When I originally downloaded it quite a while ago, I left it in a sub-sub-folder of Downloads, thinking I’d just experiment, but never really did anything except kick a few tires. Then over last weekend I tried using it to spin up instances of small ColdBox projects, rather then mess with whole new Lucee instances etc. Worked great for that, think it’s going to be part of my dev process, so I want to move it to a less ad hoc location.
Does it even matter where it and the JRE next it it live, as long as my Path points to it? Are there other dependencies on that location, like stuff in .CommandBox?
Ah yes, so you can move the binary anywhere you like and CommandBox won’t care. I would put it somewhere that’s in your system’s path so you can run “box” commands from your OS shell anywhere. There’s nothing in the .CommandBox folder that keeps track of where the actual box.exe is. Anything that uses the binary is dynamically figured out at run time.
Thanks!
~Brad
ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Great, thanks.
Related, what’s the canonical way of launching and pointing to a particular instance? I created a shortcut to box.exe in a project folder, that didn’t work until I set its Start In attribute to point there, but that did work. However, I’d guess (haven’t tried it yet) that if I want to spin up another project, double clicking a similar shortcut there will launch a new box.exe instance, not ideal I’d think. I know that with box running I can start any existing server by its name, wherever it is, but I’m wondering if there’s a similar thing for navigation, like ‘cd {ServerName}’. Does anything like that exist?
Thanks again,
Dave
Related, what’s the canonical way of launching and pointing to a particular instance?
I’m not exactly sure what you’re asking, but I typically open CommandBox via a pin on my task bar, CD to the directory of the server, and run “start”. That’s on Windows where I use a GUI. On Linux boxes that I SSH into, I have box in the system path and I simply run “box” from anywhere.
I created a shortcut to box.exe in a project folder
Don’t do that-- it’s really not a good way to use a CLI-based tool. You’d be better off adding it to the windows system path so you can just run “box …” commands from anywhere.
However, I’d guess (haven’t tried it yet) that if I want to spin up another project, double clicking a similar shortcut there will launch a new box.exe instance, not ideal I’d think.
I’m not sure what to tell you-- if don’t want two instances of CommandBox, then don’t start both of them! It’s your computer so it’s up to you to keep track of whether you have ComandBox open already. This is the same with any software.
I know that with box running I can start any existing server by its name
Well, this has nothing to do with box running-- you can start any server by name that has been started at least once.
I’m wondering if there’s a similar thing for navigation, like ‘cd {ServerName}’. Does anything like that exist?
Yes, it does! What you want is the “server cd {serverName}” command. I created it for this purpose to make it easier to jump around inside the interactive shell. It will drop you in the web root of the server.
Thanks!
~Brad
ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Thanks once again for your helpful answers, and for the stuff you’ve thought of that’s built into CommandBox. Great tool.