Is there an Interceptor in CommandBox which I can ...
# box-products
e
Is there an Interceptor in CommandBox which I can use to run a custom task runner only once when the CLI finishes running and setting up for the first time? I don't see one here: https://commandbox.ortusbooks.com/developing-for-commandbox/interceptors/core-interception-points.
onCLIStart
seems to run every time the CLI starts, not just the first time.
b
@evagoras You could set a config setting or write a file to disk after the first time to short circuit subsequent runs
But, no there is not a baked-in first time only interception point
e
Thanks Brad. Good idea about the config or file as a check. Will try that.
b
@evagoras Would a server.cfc work for you? https://docs.lucee.org/guides/cookbooks/Startup_Listeners.html You could also maybe work out a bash script that would run subsequent commands after start up. Throwing darts as I've never used the task runners.
b
He's asking about what interception points exist. You're talking abouit how to respond to them 🙂
e
@byron70 I am looking more for something that runs the first time the CommandBox CLI installs. The
server.cfc
would be useful to run code when an individual site under CommandBox starts.