BoxLang: Our new JVM Dynamic Language made by Ortus! Check it out: https://www.boxlang.io

All work

Select view

Select search mode

 
50 of 764

Allow a package to have listener scripts run by convention

Fixed

Description

Following the idea behind npm's run-script command, allow for a "scripts" struct in box.json where the key is a short-name for the script and the value is command string to run through the CommandBox interactive shell.

{ "scripts" : { "postVersion" : "!git push", "foo" : "version" } }

Users will be able to target a script like so:

box runScript foo

Any script whose short name is also the name of an interception point in CommandBox will also be run when the CWD of the shell or running command is that package. This will allow developers to create portable ad-hoc listeners for a package that fire.

If the script fails, no further interceptors or commands in the pipeline should process. For example, if the "prePublish" script executes "testbox run" and the tests fail, the version should not be bumped.tagged, etc.

Gliffy Diagrams

Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Affects versions

Fix versions

Original estimate

Time tracking

No time logged2h remaining

Priority

Sentry

Created April 26, 2016 at 8:47 PM
Updated April 27, 2016 at 5:39 AM
Resolved April 27, 2016 at 5:33 AM

Activity

Show:

Brad Wood April 27, 2016 at 5:38 AM

package set scripts.postVersion="package set location='gitUser/gitRepo#\`package version\`'" package set scripts.onServerStart="echo 'thanks for starting me'"

creates

{ "postVersion":"package set location='gitUser/gitRepo#`package version`'", "onServerStart":"echo 'thanks for starting me'" }

Now to use them...

CommandBox:forgetest> bump --minor Set version = 4.23.0 Package is a Git repo. Tagging... Tag [v4.23.0] created. Running postVersion package script. > package set location='gitUser/gitRepo#`package version`' Set location = gitUser/gitRepo#4.23.0
CommandBox:forgetest> start Running onServerStart package script. > echo 'thanks for starting me' thanks for starting me The server for C:\sandbox\forgetest is starting on 127.0.0.1:28282... type 'server status' to see result

Flag notifications