Skip to main content

workflows_of

Function workflows_of 

Source
pub fn workflows_of(document: &Value) -> Vec<WorkflowDescriptor>
Expand description

Every public workflow of a just --dump --dump-format json document, sorted by name.

Recipes of imported modules are included under their module’s name, which is how a modular justfile stays one catalogue rather than becoming several.

use majordomus_cli::environment::workflows::workflows_of;
let document = serde_json::json!({
    "recipes": {
        "build": { "name": "build", "doc": "Build it.", "private": false,
                   "attributes": [{"group": "build"}], "parameters": [], "dependencies": [] },
        "_hidden": { "name": "_hidden", "doc": null, "private": true,
                     "attributes": [], "parameters": [], "dependencies": [] }
    },
    "modules": {}
});
let found = workflows_of(&document);
assert_eq!(found.len(), 1, "a private recipe is not a workflow");
assert_eq!(found[0].name, "build");
assert_eq!(found[0].group.as_deref(), Some("build"));