githubEdit

What's New in 4.2.0

Random Fixes

In no particular order...

  • Fix background colors not showing up in Powershell and Windows cmd

  • System Setting expansions not always working in server.json

  • testbox run no longer blindly assumes you're returning JSON.

  • Piping commands into box was broken since 4.0.0

  • Starting server with --debug didn't output logs on error.

Random New Features

Sorted by createUUID() DESC...

  • Custom commands have more control over their tab completion candidates. Docs Herearrow-up-right

  • Control how many levels deep package list displays

  • New versions of Lucee, JGit, JLine, and WireBox

  • More pack200 of the Lucee jar (and more improvements to come soon in the next version of Lucee)

  • Automatic detection for build servers like Travis-CI to hide progress bar animations. Docs Herearrow-up-right

  • Cloning Git repos during install has a nice new progress bar that plays well with interactive jobsarrow-up-right

  • You can use the aforementioned progress bar for your own purposes in custom commands and Task Runners. Docs Herearrow-up-right

Improvements to Native Binaries

The run command has been a pain over the last few versions as every "fix" has seemed to lead to another regression. We've made some more changes to try and get each use case working as expected with no annoying bash messages about "job control". Fingers crossed.

Single one-off command, streams output to console as it comes.

Piping output of native binary into another Command (output captured all together and not streamed).

Running interactive commands. No output at all really, standard input and output of CommandBox bound directly to native shell

Better Exit Code handling

You can now control the exit code that CommandBox (or your recipe) exits with. Remember, zero is successful, any other number is failure.

Access the Exit Code of the previous command via a System Setting expansion of**${exitCode}**.

Recipes now have better support for exit codes. If a command throws an error OR returns a non-zero exit code, the recipe will stop and the exit code of the last command will be returned as the exit code from the recipe command. And if it was a non-interactive shell, the exit code will flow all the way back to the operating system from the box binary. Also, running "exit" inside of a recipe will no longer exit the entire shell, but just that recipe execution. This give you a lot better control over your recipes.

https://commandbox.ortusbooks.com/usage/execution/exit-codesarrow-up-right

Command Chaining

Let's take a moment to review an existing but little known feature of CommandBox that we borrowed from bash. This is not new, but you need to know this for the following section to make any sense. Similar to bash, CommandBox allows you to chain multiple commands together on the same line and make them conditional on whether the previous command was successful or not.

&&

You can use && to run the second command only if the previous one succeeded.

||

You can use || to run the second command only if the previous one failed.

;

You can use a single semicolon (;) to separate commands and each command will run regardless of the success or failure of the previous command.

New Assertion Commands

With the above building blocks, we can get clever to create simple conditionals to only run commands if a condition is met. Or these can simply be used to cause recipes to stop execution or to fail builds based on a condition. The following commands output nothing, but they return an appropriate exit code based on their inputs.

https://commandbox.ortusbooks.com/usage/execution/exit-codes#assertionsarrow-up-right

pathExists

Returns a passing (0) or failing (1) exit code whether the path exists.

You can specify if the path needs to be a file or a folder.

assertTrue

Returns a passing (0) or failing (1) exit code whether truthy parameter passed. Truthy values are "yes", "true" and positive integers. All other values are considered falsy

assertEqual

Returns a passing (0) or failing (1) exit code whether both parameters match. Comparison is case insensitive.

New S3 Endpoint for Installing Packages

Big thanks to John Berquist and Dominic Watson for helping add this new feature. You can now install packages directly from S3, Amazon S3, Digital Ocean Spaces and Google Disk.

There are several different authentications mechanisms available too:

  • Per bucket credentials in your CommandBox endpoint settings

  • Global credentials in your CommandBox endpoint settings

  • Environment variables

  • AWS credentials file

  • IAM role

The full docs are here:

https://commandbox.ortusbooks.com/package-management/code-endpoints/s3arrow-up-right

Updated Server Tray Menus

We've added 17 pieces of flair to our server tray menus to show you more information such as PID, webroot, and port as well as a new option to open up the web root in your file system explorer.

Release Notes

Here's the full list of everything that changed in CommandBox 4.2.0.

Bug

New Feature

Improvement

Last updated

Was this helpful?