What's New in 4.4.0

Iterate over JSON with foreach command

The foreach command which was introduced recently and allows you to iterate over any list of input and run a command using each item in the list has been enhanced to also allow you to iterate from the CLI over any JSON string that you pipe in.
1
package show dependencies | foreach
Copied!

Directory Watchers have more data

Now when you create a directory watcher in a task runner or custom command, you can not only get notified when something in that directory changes, but you also now receive a list of files added, removed, and modified.
1
watch()
2
.onChange( function( paths ) {
3
print
4
.line( '#paths.added.len()# paths were added!' )
5
.line( '#paths.removed.len()# paths were removed!' )
6
.line( '#paths.changed.len()# paths were changed!' ) ;
7
} )
8
.start();
Copied!

New "coldbox watch-reinit" command

Thanks to Scott Steinbeck, we have a new command called coldbox watch-reinit. This will watch for changes to certain files in your project and will automatically issue a framework reinit when you edit things like configs or services.
1
package set reinitWatchPaths= "config/**.cfc,models/**.cfc,ModuleConfig.cfc"
2
coldbox watch-reinit
Copied!

Color all the JSONs

Thanks to John Berquist, CommandBox now has sweet color coding any time it outputs JSON to the screen. Try it out by running something like "server show".
Users can also customize the colors they see for JSON with the following config settings:
  • json.ansiColors.constant
  • json.ansiColors.key
  • json.ansiColors.number
  • json.ansiColors.string
Setting values can be any color name from the system-colors command.

New Gist endpoint

Thanks to Jason Steinshouer we have a new Gist endpoint for installing code from a public Gist.
1
install gist:b6cfe92a08c742bab78dd15fc2c1b2bb
Copied!

4.4.0 Release Notes

Bug

New Feature

Improvement