task runcommand will look for a default task name of
task.cfcin the current working directory. The default target (or method) is called
run. Therefore, when you run
./task.cfcrelative to your current working directory.
commandbox.system.BaseTaskclass, but it isn't necessary for your to extend it manually. CommandBox will add in virtual inheritance for you. The task CFCs can live wherever you want in your project (or outside of it!) and can have any name you wish. Since tasks are not scanned and registered by CommandBox, but rather created on-the-fly by convention, you don't have to worry about more than one task in different projects with the same name. That means, each of your projects can have a
workbench/build.cfctask runner and they won't collide. When you run the task, the correct CFC will be located based on your current working directory. Therefore, tasks are not "global" like commands, but rather in the context of a given project or folder.
.cfcpart of the name, though we'll forgive you if you do!
variables.wireboxvariable as well as their own
getInstance()method which proxies to WireBox to get objects.
application.cfm, but you can use the cfapplication tag (or script variant:
application) to modify the properties and behaviors of the Task Runner application. Any setting that can be modified using cfapplication can be modified in Task Runners as follows:
cfapplicationwill last for the duration of the CLI shell and will affect any and all code run from the CLI including the CommandBox core code.
cfmailmaking sure you set
async=false(see below). Not setting this flag to
falsemay result in undelivered email because mail may still exist in Lucee spooler (Lucee tasks) when your task runner exits.