Uploaded image for project: 'CommandBox'
  1. COMMANDBOX-921

Allow recipe args to be used as environment variables for that command

    Details

    • Type: New Feature
    • Status: Resolved (View workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5.0
    • Component/s: None
    • Labels:
      None

      Description

      Recipes receive args via a manual argument binding process with placeholders like $name and $1. Now that we have proper env vars, set the args into the local env struct for the recipe so the standard environment expansions of ${name} and ${1} and ${name:default} can be used.

      This also means the args will be available to any nested commands running from the recipe, which makes them more powerful and easier to specify default values. This also means users get programmatic access to them via the "env" namespace.

      echo "You passed `env show | #structCount` arguments to this recipe"
      echo "They are as follows:"
      env show | foreach "echo '\${item} = \${value}'"
      

      Leave the $name and $1 bindings in place for backwards compatibility.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bradwood Brad Wood
                Reporter:
                bradwood Brad Wood
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: