{
  "id": "6C731C3C-3C68-459A-A5C9-BDE6E6595B5B",
  "name": "Bash",
  "friendlyName": "Bash",
  "description": "Run a Bash script on macOS, Linux, or Windows",
  "helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash",
  "helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?linkid=2132213) or [see the Bash documentation](https://www.gnu.org/software/bash/manual/)",
  "category": "Utility",
  "visibility": [
    "Build",
    "Release"
  ],
  "runsOn": [
    "Agent",
    "DeploymentGroup"
  ],
  "author": "Microsoft Corporation",
  "version": {
    "Major": 3,
    "Minor": 268,
    "Patch": 1
  },
  "releaseNotes": "Script task consistency. Added support for multiple lines and added support for Windows.",
  "minimumAgentVersion": "2.115.0",
  "instanceNameFormat": "Bash Script",
  "showEnvironmentVariables": true,
  "groups": [
    {
      "name": "advanced",
      "displayName": "Advanced",
      "isExpanded": false
    }
  ],
  "inputs": [
    {
      "name": "targetType",
      "type": "radio",
      "label": "Type",
      "required": false,
      "defaultValue": "filePath",
      "helpMarkDown": "Target script type: File Path or Inline",
      "options": {
        "filePath": "File Path",
        "inline": "Inline"
      }
    },
    {
      "name": "filePath",
      "type": "filePath",
      "label": "Script Path",
      "visibleRule": "targetType = filePath",
      "required": true,
      "defaultValue": "",
      "helpMarkDown": "Path of the script to execute. Must be a fully qualified path or relative to $(System.DefaultWorkingDirectory)."
    },
    {
      "name": "arguments",
      "type": "string",
      "label": "Arguments",
      "visibleRule": "targetType = filePath",
      "required": false,
      "defaultValue": "",
      "helpMarkDown": "Arguments passed to the shell script. Either ordinal parameters or named parameters."
    },
    {
      "name": "script",
      "type": "multiLine",
      "label": "Script",
      "visibleRule": "targetType = inline",
      "required": true,
      "defaultValue": "# Write your commands here\n\necho 'Hello world'\n",
      "properties": {
        "resizable": "true",
        "rows": "10",
        "maxLength": "5000"
      },
      "helpMarkDown": ""
    },
    {
      "name": "workingDirectory",
      "type": "filePath",
      "label": "Working Directory",
      "defaultValue": "",
      "required": false,
      "groupName": "advanced"
    },
    {
      "name": "failOnStderr",
      "type": "boolean",
      "label": "Fail on Standard Error",
      "defaultValue": "false",
      "required": false,
      "helpMarkDown": "If this is true, this task will fail if any errors are written to the StandardError stream.",
      "groupName": "advanced"
    },
    {
      "name": "bashEnvValue",
      "type": "string",
      "label": "Set value for BASH_ENV environment variable",
      "defaultValue": "",
      "required": false,
      "helpMarkDown": "If input is specified, it's value is expanded and used as the path of a startup file to execute before running the script. If the environment variable `BASH_ENV` has already been defined, the task will override this variable only for the current task. You can find more details by [link](https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html).",
      "groupName": "advanced"
    }
  ],
  "execution": {
    "Node10": {
      "target": "bash.js",
      "argumentFormat": ""
    },
    "Node16": {
      "target": "bash.js",
      "argumentFormat": ""
    },
    "Node20_1": {
      "target": "bash.js",
      "argumentFormat": ""
    },
    "Node24": {
      "target": "bash.js",
      "argumentFormat": ""
    }
  },
  "messages": {
    "GeneratingScript": "Generating script.",
    "JS_ExitCode": "Bash exited with code '%s'.",
    "JS_ExitCode_137": "Bash exited with code 137, which means it ran out of memory. Make sure the agent (container) host has sufficient memory configured.",
    "JS_FormattedCommand": "Formatted command: %s",
    "JS_InvalidFilePath": "Invalid file path '%s'.",
    "JS_ScriptContents": "Script contents:",
    "JS_Stderr": "Bash wrote one or more lines to the standard error stream.",
    "JS_TranslatePathFailed": "Unable to translate the path '%s' to the Linux file system.",
    "JS_BashEnvAlreadyDefined": "The BASH_ENV environment variable has already been set to a '%s', the task will override it with '%s'",
    "ScriptArgsSanitized": "Detected characters in arguments that may not be executed correctly by the shell. Please escape special characters using backslash (\\). More information is available here: https://aka.ms/ado/75787"
  }
}
