Skip to main content

Grouping Scripts Definition

jko also defines the | operator, which allows grouping scripts elements that share the same definition.

  • The | operator separates multiple script names.
  • All grouped scripts share the same command, e.g. "someCommand".
  • This simplifies script management by reducing redundancy.
export default {
scripts: {
"yourScript1 | yourScript2 | yourScript3": "someCommand"
}
}

This can be used even with jko directives, which can be combined:

 "$directiveName1 (scriptName1) | $directiveNameN (scriptNameN)": "value"

e.g.

export default {
scripts: {
"$disable (yourScript1) | yourScript2 | $pre(yourScript3)": "someCommand"
"$pre(yourScript1) | $post(yourScript2) | yourScript3": "someCommand2"
"$comment(yourScript1) | $comment(yourScript2) | $comment(yourScript3)": "This script will ..."
}
}
danger

Directives are apply to a single script, meaning | cannot be used within them.

Was this content valuable?