From f72e5f45bed0b8c82c3259ae3ee36aaa19f0556c Mon Sep 17 00:00:00 2001 From: Pranshu-Negi Date: Tue, 3 Jan 2023 16:10:49 +0100 Subject: [PATCH] Migrate Tasks to Node 16 --- .../azure-pipelines-task-lib/LICENSE | 22 + .../azure-pipelines-task-lib/README.md | 74 + .../resources.resjson/de-DE/resources.resjson | 35 + .../resources.resjson/en-US/resources.resjson | 35 + .../resources.resjson/es-ES/resources.resjson | 35 + .../resources.resjson/fr-FR/resources.resjson | 35 + .../resources.resjson/it-IT/resources.resjson | 35 + .../resources.resjson/ja-JP/resources.resjson | 35 + .../resources.resjson/ko-KR/resources.resjson | 35 + .../resources.resjson/ru-RU/resources.resjson | 35 + .../resources.resjson/zh-CN/resources.resjson | 35 + .../resources.resjson/zh-TW/resources.resjson | 35 + .../ThirdPartyNotice.txt | 1114 +++++++++ .../azure-pipelines-task-lib/internal.d.ts | 130 ++ .../azure-pipelines-task-lib/internal.js | 885 ++++++++ .../azure-pipelines-task-lib/lib.json | 37 + .../azure-pipelines-task-lib/mock-answer.d.ts | 55 + .../azure-pipelines-task-lib/mock-answer.js | 41 + .../azure-pipelines-task-lib/mock-run.d.ts | 44 + .../azure-pipelines-task-lib/mock-run.js | 92 + .../azure-pipelines-task-lib/mock-task.d.ts | 111 + .../azure-pipelines-task-lib/mock-task.js | 447 ++++ .../azure-pipelines-task-lib/mock-test.d.ts | 28 + .../azure-pipelines-task-lib/mock-test.js | 295 +++ .../mock-toolrunner.d.ts | 41 + .../mock-toolrunner.js | 268 +++ .../azure-pipelines-task-lib/package.json | 77 + .../azure-pipelines-task-lib/task.d.ts | 718 ++++++ .../azure-pipelines-task-lib/task.js | 2004 +++++++++++++++++ .../azure-pipelines-task-lib/taskcommand.d.ts | 10 + .../azure-pipelines-task-lib/taskcommand.js | 103 + .../azure-pipelines-task-lib/toolrunner.d.ts | 159 ++ .../azure-pipelines-task-lib/toolrunner.js | 968 ++++++++ .../azure-pipelines-task-lib/vault.d.ts | 10 + .../azure-pipelines-task-lib/vault.js | 71 + Utilites/Shell++/task.js | 2 +- Utilites/Shell++/task.json | 10 +- 37 files changed, 8164 insertions(+), 2 deletions(-) create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/LICENSE create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/README.md create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/de-DE/resources.resjson create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/en-US/resources.resjson create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/es-ES/resources.resjson create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/fr-FR/resources.resjson create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/it-IT/resources.resjson create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/ja-JP/resources.resjson create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/ko-KR/resources.resjson create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/ru-RU/resources.resjson create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/zh-CN/resources.resjson create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/zh-TW/resources.resjson create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/ThirdPartyNotice.txt create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/internal.d.ts create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/internal.js create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/lib.json create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-answer.d.ts create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-answer.js create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-run.d.ts create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-run.js create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-task.d.ts create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-task.js create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-test.d.ts create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-test.js create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-toolrunner.d.ts create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-toolrunner.js create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/package.json create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/task.d.ts create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/task.js create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/taskcommand.d.ts create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/taskcommand.js create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/toolrunner.d.ts create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/toolrunner.js create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/vault.d.ts create mode 100644 Utilites/Shell++/node_modules/azure-pipelines-task-lib/vault.js diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/LICENSE b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/LICENSE new file mode 100644 index 0000000..bb81c0a --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) Microsoft Corporation. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/README.md b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/README.md new file mode 100644 index 0000000..d840cec --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/README.md @@ -0,0 +1,74 @@ + +# Azure Pipelines Task SDK + +Libraries for writing [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines) tasks + +Reference examples of our in the box tasks [are here](https://github.com/Microsoft/azure-pipelines-tasks) + +## TypeScript Tasks + +Cross platform tasks are written in TypeScript. It is the preferred way to write tasks once. + +[![NPM version][npm-lib-image]][npm-lib-url] + +Step by Step: [Create Task](https://docs.microsoft.com/en-us/azure/devops/extend/develop/add-build-task?view=vsts) + +Documentation: [TypeScript API](docs/azure-pipelines-task-lib.md), [task JSON schema](https://aka.ms/vsts-tasks.schema.json) + +Guidance: [Finding Files](docs/findingfiles.md), [Minimum agent version](docs/minagent.md), [Proxy](docs/proxy.md), [Certificate](docs/cert.md) + +## Node 10 Upgrade Notice + +Azure DevOps is currently working to establish Node 10 as the new preferred runtime for tasks, upgrading from Node 6. +Relevant work is happening in the `master` branch and the major version should be used with Node 10 is 3. +Previous major version is stored in the `releases/2.x` + +### Upgrading to Node 10 + +Upgrading your tasks from Node 6 should be relatively painless, however there are some things to note: +* Typescript has been upgraded to TS 4. Older versions of TS may or may not work with Node 14 or the 3.x branch. We recommend upgrading to TS 4 when upgrading to task-lib 3.x. +* Node has made some changes to `fs` between Node 6 and Node 10. It is worth reviewing and testing your tasks thoroughly before publishing updates to Node 10. + +## Reference Examples + +The [ShellScript Task](https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks/ShellScriptV2) and the [XCode Task](https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks/XcodeV5) are good examples. + +## Contributing + +We are accepting contributions and we try to stay on top of issues. + +[Contribution Guide](../CONTRIBUTING.md). + +[Logging Issues](https://github.com/Microsoft/azure-pipelines-task-lib/issues) + +## Building the library + +Once: +```bash +$ cd node +$ npm install +``` + +Build and Test: +```bash +$ npm test +``` + +Set environment variable TASK_TEST_TRACE=1 to display test output. + +[npm-lib-image]: https://img.shields.io/npm/v/azure-pipelines-task-lib.svg?style=flat +[npm-lib-url]: https://www.npmjs.com/package/azure-pipelines-task-lib + +## Powershell + +We also maintain a PowerShell library for Windows task development. + +Library: [Powershell Library](../powershell) + +Usage: [Consuming the SDK](../powershell/Docs/Consuming.md) + +## Third Party Notices +To generate/update third party notice file run: +```bash +$ node generate-third-party-notice.js +``` diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/de-DE/resources.resjson b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/de-DE/resources.resjson new file mode 100644 index 0000000..efd6ee7 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/de-DE/resources.resjson @@ -0,0 +1,35 @@ +{ + "loc.messages.LIB_UnhandledEx": "Ausnahmefehler: %s", + "loc.messages.LIB_FailOnCode": "Fehler beim Rückgabecode: %d", + "loc.messages.LIB_MkdirFailed": "Das Verzeichnis \"%s\" kann nicht erstellt werden. %s", + "loc.messages.LIB_MkdirFailedFileExists": "Das Verzeichnis \"%s\" kann nicht erstellt werden. Eine in Konflikt stehende Datei ist vorhanden: \"%s\"", + "loc.messages.LIB_MkdirFailedInvalidDriveRoot": "Das Verzeichnis \"%s\" kann nicht erstellt werden. Das Stammverzeichnis ist nicht vorhanden: %s", + "loc.messages.LIB_MkdirFailedInvalidShare": "Das Verzeichnis \"%s\" kann nicht erstellt werden. Es kann nicht überprüft werden, ob das Verzeichnis vorhanden ist: {%s}. Wenn das Verzeichnis eine Dateifreigabe ist, stellen Sie sicher, dass der Freigabename richtig, die Freigabe online und der aktuelle Prozess berechtigt ist, auf die Freigabe zuzugreifen.", + "loc.messages.LIB_MultilineSecret": "Geheimnisse dürfen nicht mehrere Zeilen enthalten", + "loc.messages.LIB_ProcessError": "Fehler beim Ausführen des Prozesses \"%s\". Möglicherweise konnte der Prozess nicht gestartet werden. Fehler: %s", + "loc.messages.LIB_ProcessExitCode": "Fehler beim Prozess \"%s\" mit Exitcode %s.", + "loc.messages.LIB_ProcessStderr": "Fehler beim Prozess \"%s\": Mindestens eine Zeile wurde in den STDERR-Datenstrom geschrieben.", + "loc.messages.LIB_ReturnCode": "Rückgabecode: %d", + "loc.messages.LIB_ResourceFileNotExist": "Die Ressourcendatei ist nicht vorhanden: %s", + "loc.messages.LIB_ResourceFileAlreadySet": "Die Ressourcendatei wurde bereits festgelegt auf: %s", + "loc.messages.LIB_ResourceFileNotSet": "Die Ressourcendatei wurde nicht festgelegt. Die Lokalisierungszeichenfolge für den folgenden Schlüssel wurde nicht gefunden: %s", + "loc.messages.LIB_StdioNotClosed": "Die STDIO-Datenströme wurden nicht innerhalb von %s Sekunden nach dem Beendigungsereignis aus dem Prozess \"%s\" geschlossen. Möglicherweise hat ein untergeordneter Prozess die STDIO-Datenströme geerbt und wurde noch nicht beendet.", + "loc.messages.LIB_WhichNotFound_Linux": "Ausführbare Datei nicht gefunden: '%s'. Prüfen Sie, ob der Dateipfad vorhanden ist oder sich die Datei in einem von der PATH-Umgebungsvariablen angegebenen Verzeichnis befindet. Prüfen Sie zudem den Dateimodus, um sicherzustellen, dass die Datei ausführbar ist.", + "loc.messages.LIB_WhichNotFound_Win": "Ausführbare Datei nicht gefunden: \"%s\". Prüfen Sie, ob der Dateipfad vorhanden ist oder sich die Datei in einem von der PATH-Umgebungsvariablen angegebenen Verzeichnis befindet. Prüfen Sie zudem, ob die Datei eine gültige Erweiterung für eine ausführbare Datei aufweist.", + "loc.messages.LIB_LocStringNotFound": "Die Lokalisierungszeichenfolge für den folgenden Schlüssel wurde nicht gefunden: %s", + "loc.messages.LIB_ParameterIsRequired": "\"%s\" wurde nicht angegeben.", + "loc.messages.LIB_InputRequired": "Eingabe erforderlich: %s", + "loc.messages.LIB_InvalidPattern": "Ungültiges Muster: \"%s\"", + "loc.messages.LIB_EndpointNotExist": "Der Endpunkt ist nicht vorhanden: %s", + "loc.messages.LIB_EndpointDataNotExist": "Der Endpunkt-Datenparameter %s ist nicht vorhanden: %s", + "loc.messages.LIB_EndpointAuthNotExist": "Die Endpunkt-Authentifizierungsdatensind nicht vorhanden: %s", + "loc.messages.LIB_InvalidEndpointAuth": "Ungültige Endpunktauthentifizierung: %s", + "loc.messages.LIB_InvalidSecureFilesInput": "Ungültige sichere Dateiausgabe: %s", + "loc.messages.LIB_PathNotFound": "Nicht gefunden %s: %s", + "loc.messages.LIB_PathHasNullByte": "Der Pfad darf keine NULL-Bytes enthalten.", + "loc.messages.LIB_OperationFailed": "Fehler %s: %s", + "loc.messages.LIB_UseFirstGlobMatch": "Mehrere Arbeitsbereichübereinstimmungen. Die erste Übereinstimmung wird verwendet.", + "loc.messages.LIB_MergeTestResultNotSupported": "Das Mergen von Testergebnissen aus mehreren Dateien in einen Testlauf wird von dieser Version des Build-Agents für OSX/Linux nicht unterstützt. Jede Testergebnisdatei wird als separater Testlauf in VSO/TFS veröffentlicht.", + "loc.messages.LIB_PlatformNotSupported": "Plattform wird nicht unterstützt: %s", + "loc.messages.LIB_CopyFileFailed": "Error while copying the file. Attempts left: %s" +} \ No newline at end of file diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/en-US/resources.resjson b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/en-US/resources.resjson new file mode 100644 index 0000000..5abc0b4 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/en-US/resources.resjson @@ -0,0 +1,35 @@ +{ + "loc.messages.LIB_UnhandledEx": "Unhandled: %s", + "loc.messages.LIB_FailOnCode": "Failure return code: %d", + "loc.messages.LIB_MkdirFailed": "Unable to create directory '%s'. %s", + "loc.messages.LIB_MkdirFailedFileExists": "Unable to create directory '%s'. Conflicting file exists: '%s'", + "loc.messages.LIB_MkdirFailedInvalidDriveRoot": "Unable to create directory '%s'. Root directory does not exist: '%s'", + "loc.messages.LIB_MkdirFailedInvalidShare": "Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.", + "loc.messages.LIB_MultilineSecret": "Secrets cannot contain multiple lines", + "loc.messages.LIB_ProcessError": "There was an error when attempting to execute the process '%s'. This may indicate the process failed to start. Error: %s", + "loc.messages.LIB_ProcessExitCode": "The process '%s' failed with exit code %s", + "loc.messages.LIB_ProcessStderr": "The process '%s' failed because one or more lines were written to the STDERR stream", + "loc.messages.LIB_ReturnCode": "Return code: %d", + "loc.messages.LIB_ResourceFileNotExist": "Resource file doesn\\'t exist: %s", + "loc.messages.LIB_ResourceFileAlreadySet": "Resource file has already set to: %s", + "loc.messages.LIB_ResourceFileNotSet": "Resource file haven\\'t set, can\\'t find loc string for key: %s", + "loc.messages.LIB_StdioNotClosed": "The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.", + "loc.messages.LIB_WhichNotFound_Linux": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.", + "loc.messages.LIB_WhichNotFound_Win": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.", + "loc.messages.LIB_LocStringNotFound": "Can\\'t find loc string for key: %s", + "loc.messages.LIB_ParameterIsRequired": "%s not supplied", + "loc.messages.LIB_InputRequired": "Input required: %s", + "loc.messages.LIB_InvalidPattern": "Invalid pattern: '%s'", + "loc.messages.LIB_EndpointNotExist": "Endpoint not present: %s", + "loc.messages.LIB_EndpointDataNotExist": "Endpoint data parameter %s not present: %s", + "loc.messages.LIB_EndpointAuthNotExist": "Endpoint auth data not present: %s", + "loc.messages.LIB_InvalidEndpointAuth": "Invalid endpoint auth: %s", + "loc.messages.LIB_InvalidSecureFilesInput": "Invalid secure file input: %s", + "loc.messages.LIB_PathNotFound": "Not found %s: %s", + "loc.messages.LIB_PathHasNullByte": "Path cannot contain null bytes", + "loc.messages.LIB_OperationFailed": "Failed %s: %s", + "loc.messages.LIB_UseFirstGlobMatch": "Multiple workspace matches. using first.", + "loc.messages.LIB_MergeTestResultNotSupported": "Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.", + "loc.messages.LIB_PlatformNotSupported": "Platform not supported: %s", + "loc.messages.LIB_CopyFileFailed": "Error while copying the file. Attempts left: %s" +} \ No newline at end of file diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/es-ES/resources.resjson b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/es-ES/resources.resjson new file mode 100644 index 0000000..24090d0 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/es-ES/resources.resjson @@ -0,0 +1,35 @@ +{ + "loc.messages.LIB_UnhandledEx": "No controlada: %s", + "loc.messages.LIB_FailOnCode": "Código de retorno de error: %d", + "loc.messages.LIB_MkdirFailed": "No se puede crear el directorio '%s'. %s", + "loc.messages.LIB_MkdirFailedFileExists": "No se puede crear el directorio '%s'. Hay un conflicto entre archivos: '%s'", + "loc.messages.LIB_MkdirFailedInvalidDriveRoot": "No se puede crear el directorio '%s'. El directorio raíz no existe: '%s'", + "loc.messages.LIB_MkdirFailedInvalidShare": "No se puede crear el directorio '%s'. No se puede comprobar si el directorio existe: '%s'. Si el directorio es un recurso compartido de archivos, compruebe que el nombre es correcto, que está en línea y que el proceso actual tiene permiso de acceso a este.", + "loc.messages.LIB_MultilineSecret": "Los secretos no pueden contener varias líneas.", + "loc.messages.LIB_ProcessError": "Error al intentar ejecutar el proceso \"%s\". Esto puede indicar que no se pudo iniciar el proceso. Error: %s", + "loc.messages.LIB_ProcessExitCode": "Error del proceso \"%s\" con el código de salida %s", + "loc.messages.LIB_ProcessStderr": "Error del proceso \"%s\" porque se escribieron una o varias líneas en la secuencia STDERR", + "loc.messages.LIB_ReturnCode": "Código de retorno: %d", + "loc.messages.LIB_ResourceFileNotExist": "El archivo de recursos no existe: %s", + "loc.messages.LIB_ResourceFileAlreadySet": "El archivo de recursos se ha establecido ya en: %s", + "loc.messages.LIB_ResourceFileNotSet": "No se ha establecido el archivo de recursos. No se encuentra la cadena localizada para la clave: %s", + "loc.messages.LIB_StdioNotClosed": "Las secuencias STDIO no se cerraron en un plazo de %s segundos desde el evento de salida del proceso \"%s\". Esto puede indicar que un proceso secundario ha heredado las secuencias STDIO y aún no se ha cerrado.", + "loc.messages.LIB_WhichNotFound_Linux": "No se puede encontrar el archivo ejecutable: \"%s\". Compruebe que la ruta de acceso del archivo existe o que el archivo se puede encontrar en un directorio especificado en la variable de entorno PATH. Revise también el modo de archivo para comprobar que el archivo es ejecutable.", + "loc.messages.LIB_WhichNotFound_Win": "No se puede encontrar el archivo ejecutable: \"%s\". Compruebe que la ruta de acceso del archivo existe o que el archivo se puede encontrar en un directorio especificado en la variable de entorno PATH. Revise también que el archivo tenga una extensión válida para un archivo ejecutable.", + "loc.messages.LIB_LocStringNotFound": "No se encuentra la cadena localizada para la clave: %s", + "loc.messages.LIB_ParameterIsRequired": "No se ha proporcionado %s", + "loc.messages.LIB_InputRequired": "Entrada requerida: %s", + "loc.messages.LIB_InvalidPattern": "Patrón no válido: '%s'", + "loc.messages.LIB_EndpointNotExist": "No hay punto de conexión: %s", + "loc.messages.LIB_EndpointDataNotExist": "El parámetro %s de datos del punto de conexión no existe: %s.", + "loc.messages.LIB_EndpointAuthNotExist": "Los datos de autenticación del punto de conexión no existen: %s.", + "loc.messages.LIB_InvalidEndpointAuth": "Autenticación de punto de conexión no válida: %s", + "loc.messages.LIB_InvalidSecureFilesInput": "Entrada de archivo seguro no válida: %s", + "loc.messages.LIB_PathNotFound": "No se encuentra %s: %s", + "loc.messages.LIB_PathHasNullByte": "La ruta de acceso no puede tener bytes nulos", + "loc.messages.LIB_OperationFailed": "Error de %s: %s", + "loc.messages.LIB_UseFirstGlobMatch": "Hay varias coincidencias en el área de trabajo. Se usará la primera.", + "loc.messages.LIB_MergeTestResultNotSupported": "Esta versión del agente de compilación para OSX/Linux no admite la fusión mediante combinación de resultados de pruebas de varios archivos en una serie de pruebas. Cada archivo de resultados de pruebas se publicará como una serie de pruebas diferente en VSO/TFS.", + "loc.messages.LIB_PlatformNotSupported": "No se admite la plataforma: %s", + "loc.messages.LIB_CopyFileFailed": "Error while copying the file. Attempts left: %s" +} \ No newline at end of file diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/fr-FR/resources.resjson b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/fr-FR/resources.resjson new file mode 100644 index 0000000..0893f6e --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/fr-FR/resources.resjson @@ -0,0 +1,35 @@ +{ + "loc.messages.LIB_UnhandledEx": "Non géré : %s", + "loc.messages.LIB_FailOnCode": "Code de retour de l'échec : %d", + "loc.messages.LIB_MkdirFailed": "Impossible de créer le répertoire '%s'. %s", + "loc.messages.LIB_MkdirFailedFileExists": "Impossible de créer le répertoire '%s'. Présence d'un fichier en conflit : '%s'", + "loc.messages.LIB_MkdirFailedInvalidDriveRoot": "Impossible de créer le répertoire '%s'. Le répertoire racine n'existe pas : '%s'", + "loc.messages.LIB_MkdirFailedInvalidShare": "Impossible de créer le répertoire '%s'. Impossible de vérifier l'existence du répertoire : '%s'. Si le répertoire est un partage de fichiers, vérifiez que le nom du partage est correct, que le partage est en ligne, et que le processus actuel est autorisé à accéder au partage.", + "loc.messages.LIB_MultilineSecret": "Les secrets ne peuvent pas contenir plusieurs lignes", + "loc.messages.LIB_ProcessError": "Erreur durant la tentative d'exécution du processus '%s'. Cela peut indiquer que le processus n'a pas réussi à démarrer. Erreur : %s", + "loc.messages.LIB_ProcessExitCode": "Échec du processus '%s'. Code de sortie : %s", + "loc.messages.LIB_ProcessStderr": "Échec du processus '%s', car une ou plusieurs lignes ont été écrites dans le flux STDERR", + "loc.messages.LIB_ReturnCode": "Code de retour : %d", + "loc.messages.LIB_ResourceFileNotExist": "Le fichier de ressources n'existe pas : %s", + "loc.messages.LIB_ResourceFileAlreadySet": "Le fichier de ressources est déjà défini : %s", + "loc.messages.LIB_ResourceFileNotSet": "Le fichier de ressources n'est pas défini. La chaîne localisée de la clé est introuvable : %s", + "loc.messages.LIB_StdioNotClosed": "Les flux STDIO ne se sont pas fermés dans les %s secondes qui ont suivi l'événement exit du processus '%s'. Cela peut indiquer qu'un processus enfant a hérité des flux STDIO et qu'il n'est pas encore sorti.", + "loc.messages.LIB_WhichNotFound_Linux": "Impossible de localiser le fichier exécutable : '%s'. Vérifiez si le chemin du fichier existe ou si le fichier peut se trouver dans un répertoire spécifié par la variable d'environnement PATH. Vérifiez également le Mode de Fichier pour déterminer si le fichier est exécutable.", + "loc.messages.LIB_WhichNotFound_Win": "Impossible de localiser le fichier exécutable : '%s'. Vérifiez si le chemin du fichier existe ou si le fichier peut se trouver dans un répertoire spécifié par la variable d'environnement PATH. Vérifiez également si le fichier a une extension de fichier exécutable valide.", + "loc.messages.LIB_LocStringNotFound": "Chaîne localisée introuvable pour la clé : %s", + "loc.messages.LIB_ParameterIsRequired": "%s non fourni", + "loc.messages.LIB_InputRequired": "Entrée nécessaire : %s", + "loc.messages.LIB_InvalidPattern": "Modèle non valide : '%s'", + "loc.messages.LIB_EndpointNotExist": "Point de terminaison absent : %s", + "loc.messages.LIB_EndpointDataNotExist": "Paramètre de données du point de terminaison %s absent : %s", + "loc.messages.LIB_EndpointAuthNotExist": "Données d'authentification du point de terminaison absentes : %s", + "loc.messages.LIB_InvalidEndpointAuth": "Authentification du point de terminaison non valide : %s", + "loc.messages.LIB_InvalidSecureFilesInput": "Entrée de fichier sécurisé non valide : %s", + "loc.messages.LIB_PathNotFound": "%s : %s introuvable", + "loc.messages.LIB_PathHasNullByte": "Le chemin ne peut pas contenir d'octets de valeur Null", + "loc.messages.LIB_OperationFailed": "Échec de %s : %s", + "loc.messages.LIB_UseFirstGlobMatch": "Plusieurs espaces de travail correspondants. Utilisation du premier d'entre eux.", + "loc.messages.LIB_MergeTestResultNotSupported": "La fusion des résultats des tests de plusieurs fichiers en une seule série de tests n'est pas prise en charge dans cette version de l'agent de build pour OSX/Linux. Chaque fichier de résultats des tests est publié en tant que série de tests distincte dans VSO/TFS.", + "loc.messages.LIB_PlatformNotSupported": "Plateforme non prise en charge : %s", + "loc.messages.LIB_CopyFileFailed": "Error while copying the file. Attempts left: %s" +} \ No newline at end of file diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/it-IT/resources.resjson b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/it-IT/resources.resjson new file mode 100644 index 0000000..362bfea --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/it-IT/resources.resjson @@ -0,0 +1,35 @@ +{ + "loc.messages.LIB_UnhandledEx": "Eccezione non gestita: %s", + "loc.messages.LIB_FailOnCode": "Codice restituito dell'errore: %d", + "loc.messages.LIB_MkdirFailed": "Non è possibile creare la directory '%s'. %s", + "loc.messages.LIB_MkdirFailedFileExists": "Non è possibile creare la directory '%s'. Esiste un file in conflitto: '%s'", + "loc.messages.LIB_MkdirFailedInvalidDriveRoot": "Non è possibile creare la directory '%s'. La directory radice non esiste: '%s'", + "loc.messages.LIB_MkdirFailedInvalidShare": "Non è possibile creare la directory '%s' perché non è possibile verificarne l'esistenza: '%s'. Se la directory è una condivisione file, verificare che il nome della condivisione sia corretto, che la condivisione sia online e che il processo corrente sia autorizzato ad accedervi.", + "loc.messages.LIB_MultilineSecret": "I segreti non possono contenere più righe", + "loc.messages.LIB_ProcessError": "Si è verificato un errore durante il tentativo di eseguire il processo '%s'. Questo errore può indicare che non è stato possibile avviare il processo. Errore: %s", + "loc.messages.LIB_ProcessExitCode": "Il processo '%s' non è riuscito. Codice di uscita: %s", + "loc.messages.LIB_ProcessStderr": "Il processo '%s' non è riuscito perché una o più righe sono state scritte nel flusso STDERR", + "loc.messages.LIB_ReturnCode": "Codice restituito: %d", + "loc.messages.LIB_ResourceFileNotExist": "Il file di risorse non esiste: %s", + "loc.messages.LIB_ResourceFileAlreadySet": "Il file di risorse è già stato impostato su %s", + "loc.messages.LIB_ResourceFileNotSet": "Il file di risorse non è stato impostato. La stringa localizzata per la chiave %s non è stata trovata", + "loc.messages.LIB_StdioNotClosed": "I flussi STDIO non si sono chiusi entro %s secondi dall'evento di uscita dal processo '%s'. Questa condizione può indicare che un processo figlio ha ereditato i flussi STDIO e non è ancora stato terminato.", + "loc.messages.LIB_WhichNotFound_Linux": "Il file eseguibile '%s' non è stato trovato. Verificare se il percorso di file esiste o il file è presente in una directory specificata dalla variabile di ambiente PATH. Controllare anche la modalità file per verificare che il file sia eseguibile.", + "loc.messages.LIB_WhichNotFound_Win": "Il file eseguibile '%s' non è stato trovato. Verificare se il percorso di file esiste o il file è presente in una directory specificata dalla variabile di ambiente PATH. Controllare anche che l'estensione sia valida per un file eseguibile.", + "loc.messages.LIB_LocStringNotFound": "La stringa localizzata per la chiave %s non è stata trovata", + "loc.messages.LIB_ParameterIsRequired": "Parametro %s non fornito", + "loc.messages.LIB_InputRequired": "Input richiesto: %s", + "loc.messages.LIB_InvalidPattern": "Criterio non valido: '%s'", + "loc.messages.LIB_EndpointNotExist": "Endpoint non presente: %s", + "loc.messages.LIB_EndpointDataNotExist": "Il parametro %s dei dati dell'endpoint non è presente: %s", + "loc.messages.LIB_EndpointAuthNotExist": "I dati di autenticazione endpoint non sono presenti: %s", + "loc.messages.LIB_InvalidEndpointAuth": "Autenticazione endpoint non valida: %s", + "loc.messages.LIB_InvalidSecureFilesInput": "L'input del file protetto non è valido: %s", + "loc.messages.LIB_PathNotFound": "Percorso %s non trovato: %s", + "loc.messages.LIB_PathHasNullByte": "Il percorso non può contenere byte Null", + "loc.messages.LIB_OperationFailed": "Operazione %s non riuscita: %s", + "loc.messages.LIB_UseFirstGlobMatch": "Sono presenti più corrispondenze dell'area di lavoro. Verrà usata la prima.", + "loc.messages.LIB_MergeTestResultNotSupported": "L'unione di più file risultanti da un'unica esecuzione dei test non è supportata in questa versione dell'agente di compilazione per OS X/Linux. Ogni file dei risultati del test verrà pubblicato come esecuzione dei test separata in VSO/TFS.", + "loc.messages.LIB_PlatformNotSupported": "Piattaforma non supportata: %s", + "loc.messages.LIB_CopyFileFailed": "Si è verificato un errore durante la copia del file. Tentativi rimasti: %s" +} \ No newline at end of file diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/ja-JP/resources.resjson b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/ja-JP/resources.resjson new file mode 100644 index 0000000..e52e130 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/ja-JP/resources.resjson @@ -0,0 +1,35 @@ +{ + "loc.messages.LIB_UnhandledEx": "未処理: %s", + "loc.messages.LIB_FailOnCode": "失敗のリターン コード: %d", + "loc.messages.LIB_MkdirFailed": "ディレクトリ '%s' を作成できません。%s", + "loc.messages.LIB_MkdirFailedFileExists": "ディレクトリ '%s' を作成できません。競合するファイルが存在します: '%s'", + "loc.messages.LIB_MkdirFailedInvalidDriveRoot": "ディレクトリ '%s' を作成できません。ルート ディレクトリが存在しません: '%s'", + "loc.messages.LIB_MkdirFailedInvalidShare": "ディレクトリ '%s' を作成できません。ディレクトリが存在することを確認できません: '%s'。ディレクトリがファイル共有である場合、その共有名が正しいこと、その共有がオンラインであること、そして現在のプロセスにその共有へのアクセス許可があることをご確認ください。", + "loc.messages.LIB_MultilineSecret": "シークレットに複数の行を含めることはできません", + "loc.messages.LIB_ProcessError": "プロセス '%s' を実行しようとしているときにエラーが発生しました。プロセスの開始に失敗したおそれがあります。エラー: %s", + "loc.messages.LIB_ProcessExitCode": "プロセス '%s' が終了コード %s で失敗しました", + "loc.messages.LIB_ProcessStderr": "1 つ以上の行が STDERR ストリームに書き込まれたため、プロセス '%s' が失敗しました", + "loc.messages.LIB_ReturnCode": "リターン コード: %d", + "loc.messages.LIB_ResourceFileNotExist": "リソース ファイルが存在しません: %s", + "loc.messages.LIB_ResourceFileAlreadySet": "リソース ファイルは既に %s に設定されています", + "loc.messages.LIB_ResourceFileNotSet": "リソース ファイルが設定されておらず、キーの loc 文字列が見つかりません: %s", + "loc.messages.LIB_StdioNotClosed": "STDIO ストリームが、プロセス '%s' の終了イベントから %s 秒以内に終了しませんでした。これは、子プロセスが STDIO ストリームを継承し、まだ終了していないことを示している可能性があります。", + "loc.messages.LIB_WhichNotFound_Linux": "実行可能ファイルが見つかりません: '%s'。ファイル パスが存在すること、またはそのファイルが PATH 環境変数で指定されたディレクトリ内にあることをご確認ください。ファイルが実行可能かどうかについてファイル モードもご確認ください。", + "loc.messages.LIB_WhichNotFound_Win": "実行可能ファイルが見つかりません: '%s'。ファイル パスが存在すること、またはそのファイルが PATH 環境変数で指定されたディレクトリ内にあることをご確認ください。そのファイルに実行可能ファイルの有効な拡張子がついていることもご確認ください。", + "loc.messages.LIB_LocStringNotFound": "キーの loc 文字列が見つかりません: %s", + "loc.messages.LIB_ParameterIsRequired": "%s が提供されていません", + "loc.messages.LIB_InputRequired": "入力が必要です: %s", + "loc.messages.LIB_InvalidPattern": "無効なパターン: '%s'", + "loc.messages.LIB_EndpointNotExist": "エンドポイントが存在しません: %s", + "loc.messages.LIB_EndpointDataNotExist": "エンドポイントのデータ パラメーター %s がありません: %s", + "loc.messages.LIB_EndpointAuthNotExist": "エンドポイントの認証データがありません: %s", + "loc.messages.LIB_InvalidEndpointAuth": "エンドポイントの認証が無効です: %s", + "loc.messages.LIB_InvalidSecureFilesInput": "無効なセキュア ファイル入力: %s", + "loc.messages.LIB_PathNotFound": "見つかりませんでした %s: %s", + "loc.messages.LIB_PathHasNullByte": "パスに null バイトを含めることはできません", + "loc.messages.LIB_OperationFailed": "失敗しました %s: %s", + "loc.messages.LIB_UseFirstGlobMatch": "複数のワークスペースが一致します。最初のワークスペースが使用されます。", + "loc.messages.LIB_MergeTestResultNotSupported": "複数のファイルからのテスト結果を 1 つのテスト実行にマージする処理は、OSX/Linux 用のビルド エージェントのこのバージョンではサポートされていません。各テスト結果ファイルが VSO/TFS で別個のテスト実行として発行されます。", + "loc.messages.LIB_PlatformNotSupported": "プラットフォームがサポートされていません: %s", + "loc.messages.LIB_CopyFileFailed": "Error while copying the file. Attempts left: %s" +} \ No newline at end of file diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/ko-KR/resources.resjson b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/ko-KR/resources.resjson new file mode 100644 index 0000000..9ed0ba5 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/ko-KR/resources.resjson @@ -0,0 +1,35 @@ +{ + "loc.messages.LIB_UnhandledEx": "처리되지 않음: %s", + "loc.messages.LIB_FailOnCode": "실패 반환 코드: %d", + "loc.messages.LIB_MkdirFailed": "'%s' 디렉터리를 만들 수 없습니다. %s", + "loc.messages.LIB_MkdirFailedFileExists": "'%s' 디렉터리를 만들 수 없습니다. 충돌하는 파일 '%s'이(가) 있습니다.", + "loc.messages.LIB_MkdirFailedInvalidDriveRoot": "'%s' 디렉터리를 만들 수 없습니다. 루트 디렉터리 '%s'이(가) 없습니다.", + "loc.messages.LIB_MkdirFailedInvalidShare": "'%s' 디렉터리를 만들 수 없습니다. '%s' 디렉터리가 있는지 확인할 수 없습니다. 디렉터리가 파일 공유인 경우 공유 이름이 올바르고, 공유가 온라인 상태이며, 현재 프로세스에 공유에 액세스할 수 있는 권한이 있는지 확인하세요.", + "loc.messages.LIB_MultilineSecret": "비밀에 여러 줄을 사용할 수 없습니다.", + "loc.messages.LIB_ProcessError": "'%s' 프로세스를 실행할 때 오류가 발생했습니다. 이는 프로세스를 시작하지 못했음을 나타낼 수 있습니다. 오류: %s", + "loc.messages.LIB_ProcessExitCode": "'%s' 프로세스가 실패함(종료 코드 %s)", + "loc.messages.LIB_ProcessStderr": "하나 이상의 줄이 STDERR 스트림에 쓰였으므로 '%s' 프로세스가 실패함", + "loc.messages.LIB_ReturnCode": "반환 코드: %d", + "loc.messages.LIB_ResourceFileNotExist": "리소스 파일이 없음: %s", + "loc.messages.LIB_ResourceFileAlreadySet": "리소스 파일이 이미 다음으로 설정됨: %s", + "loc.messages.LIB_ResourceFileNotSet": "리소스 파일이 설정되지 않았고 키에 대한 loc 문자열을 찾을 수 없음: %s", + "loc.messages.LIB_StdioNotClosed": "STDIO 스트림이 %s초 이내('%s' 프로세스의 종료 이벤트 후)에 닫히지 않았습니다. 이는 자식 프로세스가 STDIO 스트림을 상속했으며 아직 종료되지 않았음을 나타낼 수 있습니다.", + "loc.messages.LIB_WhichNotFound_Linux": "실행 파일 '%s'을(를) 찾을 수 없습니다. 파일 경로가 있는지 또는 PATH 환경 변수에서 지정한 디렉터리 내에서 파일을 찾을 수 있는지 확인하세요. 또한 파일 모드를 확인하여 파일을 실행할 수 있는지 확인하세요.", + "loc.messages.LIB_WhichNotFound_Win": "실행 파일 '%s'을(를) 찾을 수 없습니다. 파일 경로가 있는지 또는 PATH 환경 변수에서 지정한 디렉터리 내에서 파일을 찾을 수 있는지 확인하세요. 또한 파일이 실행 파일에 대해 올바른 확장명을 가지고 있는지 확인하세요.", + "loc.messages.LIB_LocStringNotFound": "키에 대한 loc 문자열을 찾을 수 없음: %s", + "loc.messages.LIB_ParameterIsRequired": "%s이(가) 제공되지 않음", + "loc.messages.LIB_InputRequired": "입력 필요: %s", + "loc.messages.LIB_InvalidPattern": "잘못된 패턴: '%s'", + "loc.messages.LIB_EndpointNotExist": "엔드포인트가 없음: %s", + "loc.messages.LIB_EndpointDataNotExist": "엔드포인트 데이터 매개 변수 %s이(가) 없음: %s", + "loc.messages.LIB_EndpointAuthNotExist": "엔드포인트 인증 데이터가 없음: %s", + "loc.messages.LIB_InvalidEndpointAuth": "잘못된 엔드포인트 인증: %s", + "loc.messages.LIB_InvalidSecureFilesInput": "보안 파일 입력이 잘못됨: %s", + "loc.messages.LIB_PathNotFound": "%s을(를) 찾을 수 없음: %s", + "loc.messages.LIB_PathHasNullByte": "경로에 null 바이트를 포함할 수 없음", + "loc.messages.LIB_OperationFailed": "%s 실패: %s", + "loc.messages.LIB_UseFirstGlobMatch": "여러 작업 영역이 일치합니다. 첫 번째 작업 영역을 사용하세요.", + "loc.messages.LIB_MergeTestResultNotSupported": "이 OSX/Linux용 빌드 에이전트 버전에서 여러 파일의 테스트 결과를 하나의 테스트 실행으로 병합하는 것을 지원하지 않습니다. 각 테스트 결과 파일은 VSO/TFS에서 별도의 테스트 실행으로 게시됩니다.", + "loc.messages.LIB_PlatformNotSupported": "지원되지 않는 플랫폼: %s", + "loc.messages.LIB_CopyFileFailed": "파일을 복사하는 동안 오류가 발생했습니다. 남은 시도 횟수: %s" +} \ No newline at end of file diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/ru-RU/resources.resjson b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/ru-RU/resources.resjson new file mode 100644 index 0000000..6d65691 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/ru-RU/resources.resjson @@ -0,0 +1,35 @@ +{ + "loc.messages.LIB_UnhandledEx": "Не обработано: %s", + "loc.messages.LIB_FailOnCode": "Код возврата при сбое: %d.", + "loc.messages.LIB_MkdirFailed": "Не удается создать каталог \"%s\". %s", + "loc.messages.LIB_MkdirFailedFileExists": "Не удается создать каталог \"%s\". Существует конфликтующий файл: \"%s\"", + "loc.messages.LIB_MkdirFailedInvalidDriveRoot": "Не удалось создать каталог \"%s\". Корневой каталог не существует: \"%s\"", + "loc.messages.LIB_MkdirFailedInvalidShare": "Не удалось создать каталог \"%s\". Не удалось проверить, существует ли каталог \"%s\". Если каталог является файловым ресурсом, убедитесь, что имя ресурса указано правильно, он работает и текущий процесс имеет разрешение на доступ к нему.", + "loc.messages.LIB_MultilineSecret": "Секрет не может быть многострочным", + "loc.messages.LIB_ProcessError": "Произошла ошибка при попытке выполнить процесс \"%s\". Это может означать, что процесс не удалось запустить. Ошибка: %s", + "loc.messages.LIB_ProcessExitCode": "Произошел сбой процесса \"%s\" с кодом выхода %s.", + "loc.messages.LIB_ProcessStderr": "Произошел сбой процесса \"%s\", так как одна или несколько строк были записаны в поток STDERR.", + "loc.messages.LIB_ReturnCode": "Код возврата: %d", + "loc.messages.LIB_ResourceFileNotExist": "Файл ресурсов не существует: %s.", + "loc.messages.LIB_ResourceFileAlreadySet": "Файл ресурсов уже задан: %s.", + "loc.messages.LIB_ResourceFileNotSet": "Файл ресурсов не задан, не удается найти локализованную строку для ключа: %s.", + "loc.messages.LIB_StdioNotClosed": "Потоки STDIO не были закрыты в течение %s с после получения события выхода от процесса \"%s\". Это может свидетельствовать о том, что дочерний процесс унаследовал потоки STDIO и еще не завершил работу.", + "loc.messages.LIB_WhichNotFound_Linux": "Не удалось найти исполняемый файл: \"%s\". Убедитесь, что путь к файлу существует и файл можно найти в каталоге, указанном переменной окружения PATH. Также проверьте режим файла, чтобы убедиться, что файл является исполняемым.", + "loc.messages.LIB_WhichNotFound_Win": "Не удалось найти исполняемый файл: \"%s\". Убедитесь, что путь к файлу существует и что файл можно найти в каталоге, указанном переменной окружения PATH. Также убедитесь, что у файла есть допустимое расширение для исполняемого файла.", + "loc.messages.LIB_LocStringNotFound": "Не удается найти локализованную строку для ключа: %s.", + "loc.messages.LIB_ParameterIsRequired": "Не указан %s.", + "loc.messages.LIB_InputRequired": "Требуется ввести данные: %s.", + "loc.messages.LIB_InvalidPattern": "Недопустимый шаблон: \"%s\"", + "loc.messages.LIB_EndpointNotExist": "Конечная точка отсутствует: %s.", + "loc.messages.LIB_EndpointDataNotExist": "Отсутствует параметр %s данных конечной точки: %s", + "loc.messages.LIB_EndpointAuthNotExist": "Отсутствуют данные для проверки подлинности конечной точки: %s", + "loc.messages.LIB_InvalidEndpointAuth": "Недопустимая проверка подлинности конечной точки: %s.", + "loc.messages.LIB_InvalidSecureFilesInput": "Недопустимые входные данные защитного файла: %s", + "loc.messages.LIB_PathNotFound": "Не найден %s: %s.", + "loc.messages.LIB_PathHasNullByte": "Путь не может содержать пустые байты.", + "loc.messages.LIB_OperationFailed": "Сбой %s: %s.", + "loc.messages.LIB_UseFirstGlobMatch": "Несколько рабочих областей совпадает, использована первая рабочая область.", + "loc.messages.LIB_MergeTestResultNotSupported": "Объединение результатов тестов из нескольких файлов в один тестовый запуск не поддерживается в этой версии агента сборки для OSX/Linux. Каждый файл результатов теста будет опубликован в качестве отдельного тестового запуска в VSO/TFS.", + "loc.messages.LIB_PlatformNotSupported": "Платформа не поддерживается: %s", + "loc.messages.LIB_CopyFileFailed": "Ошибка при копировании файла. Оставшееся число попыток: %s." +} \ No newline at end of file diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/zh-CN/resources.resjson b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/zh-CN/resources.resjson new file mode 100644 index 0000000..5b59ead --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/zh-CN/resources.resjson @@ -0,0 +1,35 @@ +{ + "loc.messages.LIB_UnhandledEx": "未处理: %s", + "loc.messages.LIB_FailOnCode": "故障返回代码: %d", + "loc.messages.LIB_MkdirFailed": "无法创建目录“%s”。%s", + "loc.messages.LIB_MkdirFailedFileExists": "无法创建目录“%s”。存在冲突文件:“%s”", + "loc.messages.LIB_MkdirFailedInvalidDriveRoot": "无法创建目录“%s”。根目录不存在:“%s”", + "loc.messages.LIB_MkdirFailedInvalidShare": "无法创建目录“%s”。无法验证“%s”目录是否存在。如果目录是文件共享,请验证共享名称是否正确、共享是否已联机以及当前进程是否有权访问该共享。", + "loc.messages.LIB_MultilineSecret": "密码不能包含多个行", + "loc.messages.LIB_ProcessError": "尝试执行进程“%s”时出错。这可能表示进程启动失败。错误: %s", + "loc.messages.LIB_ProcessExitCode": "进程“%s”失败,退出代码为 %s", + "loc.messages.LIB_ProcessStderr": "进程“%s”失败,因为已将一行或多行写入 STDERR 流", + "loc.messages.LIB_ReturnCode": "返回代码: %d", + "loc.messages.LIB_ResourceFileNotExist": "资源文件不存在: %s", + "loc.messages.LIB_ResourceFileAlreadySet": "资源文件已被设置为 %s", + "loc.messages.LIB_ResourceFileNotSet": "资源文件尚未设置,无法找到关键字的本地字符串: %s", + "loc.messages.LIB_StdioNotClosed": "STDIO 流在进程“%s”中发生退出事件 %s 秒内未关闭 。这可能表示子进程继承了 STDIO 流且尚未退出。", + "loc.messages.LIB_WhichNotFound_Linux": "无法定位可执行文件: \"%s\"。请验证文件路径是否存在或文件是否可在 PATH 环境变量指定的目录内找到。另请检查文件模式以验证文件是否可执行。", + "loc.messages.LIB_WhichNotFound_Win": "无法定位可执行文件: \"%s\"。请验证文件路径是否存在或文件是否可在 PATH 环境变量指定的目录内找到。另请验证该文件是否具有可执行文件的有效扩展名。", + "loc.messages.LIB_LocStringNotFound": "无法找到关键字的本地字符串: %s", + "loc.messages.LIB_ParameterIsRequired": "未提供 %s", + "loc.messages.LIB_InputRequired": "输入必需项: %s", + "loc.messages.LIB_InvalidPattern": "无效的模式: \"%s\"", + "loc.messages.LIB_EndpointNotExist": "终结点不存在: %s", + "loc.messages.LIB_EndpointDataNotExist": "终结点数据参数 %s 不存在: %s", + "loc.messages.LIB_EndpointAuthNotExist": "终结点授权数据不存在: %s", + "loc.messages.LIB_InvalidEndpointAuth": "终结点验证无效: %s", + "loc.messages.LIB_InvalidSecureFilesInput": "无效的安全文件输入: %s", + "loc.messages.LIB_PathNotFound": "找不到 %s: %s", + "loc.messages.LIB_PathHasNullByte": "路径不能包含 null 字节", + "loc.messages.LIB_OperationFailed": "%s 失败: %s", + "loc.messages.LIB_UseFirstGlobMatch": "出现多个工作区匹配时,使用第一个。", + "loc.messages.LIB_MergeTestResultNotSupported": "此版本的 OSX/Linux 生成代理不支持来自某个测试运行的多文件合并测试结果,在 VSO/TFS 中,每个测试结果文件都将作为单独的测试运行进行发布。", + "loc.messages.LIB_PlatformNotSupported": "平台不受支持: %s", + "loc.messages.LIB_CopyFileFailed": "复制文件时出错。剩余尝试次数: %s" +} \ No newline at end of file diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/zh-TW/resources.resjson b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/zh-TW/resources.resjson new file mode 100644 index 0000000..e9366cd --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/Strings/resources.resjson/zh-TW/resources.resjson @@ -0,0 +1,35 @@ +{ + "loc.messages.LIB_UnhandledEx": "未經處理: %s", + "loc.messages.LIB_FailOnCode": "傳回程式碼失敗: %d", + "loc.messages.LIB_MkdirFailed": "無法建立目錄 '%s'。%s", + "loc.messages.LIB_MkdirFailedFileExists": "無法建立目錄 '%s'。存在衝突的檔案: '%s'", + "loc.messages.LIB_MkdirFailedInvalidDriveRoot": "無法建立目錄 '%s'。根目錄不存在: '%s'", + "loc.messages.LIB_MkdirFailedInvalidShare": "無法建立目錄 '%s'。無法驗證目錄是否存在: '%s'。如果目錄是檔案共用,請驗證共用名稱正確、共用在線上,而且目前的流程具有存取共用的權限。", + "loc.messages.LIB_MultilineSecret": "祕密不得包含多個行", + "loc.messages.LIB_ProcessError": "嘗試執行處理序 '%s' 時發生錯誤。這可能表示處理序無法啟動。錯誤: %s", + "loc.messages.LIB_ProcessExitCode": "處理序 '%s' 失敗,結束代碼為 %s", + "loc.messages.LIB_ProcessStderr": "因為 STDERR 資料流中寫入了一或多行程式碼,所以處理序 '%s' 失敗", + "loc.messages.LIB_ReturnCode": "傳回程式碼: %d", + "loc.messages.LIB_ResourceFileNotExist": "資源檔案不存在: %s", + "loc.messages.LIB_ResourceFileAlreadySet": "資源檔案已設定至: %s", + "loc.messages.LIB_ResourceFileNotSet": "尚未設定資源檔案,找不到索引鍵的 loc 字串: %s", + "loc.messages.LIB_StdioNotClosed": "STDIO 資料流未在 %s 秒內關閉 (從處理序 '%s' 結束事件發生後算起)。這可能表示子處理序繼承了 STDIO 資料流且尚未結束。", + "loc.messages.LIB_WhichNotFound_Linux": "找不到可執行檔: '%s'。請確認檔案路徑存在,或檔案可以在 PATH 環境變數指定的目錄中找到。另請檢查檔案模式,確認檔案可以執行。", + "loc.messages.LIB_WhichNotFound_Win": "找不到可執行檔: '%s'。請確認檔案路徑存在,或檔案可以在 PATH 環境變數指定的目錄中找到。另請確認檔案具備有效的可執行檔副檔名。", + "loc.messages.LIB_LocStringNotFound": "找不到索引鍵的 loc 字串: %s", + "loc.messages.LIB_ParameterIsRequired": "未提供 %s", + "loc.messages.LIB_InputRequired": "需要輸入內容: %s", + "loc.messages.LIB_InvalidPattern": "模式無效: '%s'", + "loc.messages.LIB_EndpointNotExist": "端點不存在: %s", + "loc.messages.LIB_EndpointDataNotExist": "端點資料參數 %s 不存在: %s", + "loc.messages.LIB_EndpointAuthNotExist": "端點驗證資料不存在: %s", + "loc.messages.LIB_InvalidEndpointAuth": "端點驗證無效: %s", + "loc.messages.LIB_InvalidSecureFilesInput": "安全檔案輸入無效: %s", + "loc.messages.LIB_PathNotFound": "找不到 %s: %s", + "loc.messages.LIB_PathHasNullByte": "路徑不能包含 null 位元組", + "loc.messages.LIB_OperationFailed": "%s 失敗: %s", + "loc.messages.LIB_UseFirstGlobMatch": "多個工作區相符。請先使用。", + "loc.messages.LIB_MergeTestResultNotSupported": "OSX/Linux 的此版本組建代理程式不支援將多個檔案的測試結果合併至單一測試回合,每個測試結果檔案將作為個別測試回合在 VSO/TFS 中發行。", + "loc.messages.LIB_PlatformNotSupported": "不支援的平台: %s", + "loc.messages.LIB_CopyFileFailed": "複製檔案時發生錯誤。剩餘嘗試次數: %s" +} \ No newline at end of file diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/ThirdPartyNotice.txt b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/ThirdPartyNotice.txt new file mode 100644 index 0000000..ddde2ac --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/ThirdPartyNotice.txt @@ -0,0 +1,1114 @@ + +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION +Do Not Translate or Localize + +This Azure Pipelines extension (azure-pipelines-task-lib) is based on or incorporates material from the projects listed below (Third Party IP). The original copyright notice and the license under which Microsoft received such Third Party IP, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft licenses the Third Party IP to you under the licensing terms for the Visual Studio Team Services extension. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. + +1. asap (git+https://github.com/kriskowal/asap.git) +2. balanced-match (git://github.com/juliangruber/balanced-match.git) +3. brace-expansion (git://github.com/juliangruber/brace-expansion.git) +4. browser-stdout (git+ssh://git@github.com/kumavis/browser-stdout.git) +5. caseless (git+https://github.com/mikeal/caseless.git) +6. concat-map (git://github.com/substack/node-concat-map.git) +7. concat-stream (git+ssh://git@github.com/maxogden/concat-stream.git) +8. core-util-is (git://github.com/isaacs/core-util-is.git) +9. fs.realpath (git+https://github.com/isaacs/fs.realpath.git) +10. has-flag (git+https://github.com/sindresorhus/has-flag.git) +11. he (git+https://github.com/mathiasbynens/he.git) +12. http-basic (git+https://github.com/ForbesLindesay/http-basic.git) +13. http-response-object (git+https://github.com/ForbesLindesay/http-response-object.git) +14. inflight (git+https://github.com/npm/inflight.git) +15. inherits (git://github.com/isaacs/inherits.git) +16. isarray (git://github.com/juliangruber/isarray.git) +17. minimatch (git://github.com/isaacs/minimatch.git) +18. minimist (git://github.com/substack/minimist.git) +19. mkdirp (git+https://github.com/substack/node-mkdirp.git) +20. mocha (git+https://github.com/mochajs/mocha.git) +21. mockery (git://github.com/mfncooper/mockery.git) +22. once (git://github.com/isaacs/once.git) +23. path-is-absolute (git+https://github.com/sindresorhus/path-is-absolute.git) +24. process-nextick-args (git+https://github.com/calvinmetcalf/process-nextick-args.git) +25. promise (git+https://github.com/then/promise.git) +26. q (git://github.com/kriskowal/q.git) +27. qs (git+https://github.com/ljharb/qs.git) +28. readable-stream (git://github.com/nodejs/readable-stream.git) +29. safe-buffer (git://github.com/feross/safe-buffer.git) +30. semver (git+https://github.com/npm/node-semver.git) +31. shelljs (git://github.com/arturadib/shelljs.git) +32. string_decoder (git://github.com/rvagg/string_decoder.git) +33. sync-request (git+https://github.com/ForbesLindesay/sync-request.git) +34. then-request (git+https://github.com/then/then-request.git) +35. typedarray (git://github.com/substack/typedarray.git) +36. typescript (git+https://github.com/Microsoft/TypeScript.git) +37. util-deprecate (git://github.com/TooTallNate/util-deprecate.git) +38. uuid (git+https://github.com/kelektiv/node-uuid.git) +39. wrappy (git+https://github.com/npm/wrappy.git) + + +%% asap NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2009–2014 Contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +========================================= +END OF asap NOTICES, INFORMATION, AND LICENSE + +%% balanced-match NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +========================================= +END OF balanced-match NOTICES, INFORMATION, AND LICENSE + +%% brace-expansion NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +MIT License + +Copyright (c) 2013 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +========================================= +END OF brace-expansion NOTICES, INFORMATION, AND LICENSE + +%% browser-stdout NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2018 kumavis + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF browser-stdout NOTICES, INFORMATION, AND LICENSE + +%% caseless NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. +END OF TERMS AND CONDITIONS +========================================= +END OF caseless NOTICES, INFORMATION, AND LICENSE + +%% concat-map NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF concat-map NOTICES, INFORMATION, AND LICENSE + +%% concat-stream NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License + +Copyright (c) 2013 Max Ogden + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF concat-stream NOTICES, INFORMATION, AND LICENSE + +%% core-util-is NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +========================================= +END OF core-util-is NOTICES, INFORMATION, AND LICENSE + +%% fs.realpath NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + Copyright Joyent, Inc. and other Node contributors. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +========================================= +END OF fs.realpath NOTICES, INFORMATION, AND LICENSE + +%% has-flag NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF has-flag NOTICES, INFORMATION, AND LICENSE + +%% he NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF he NOTICES, INFORMATION, AND LICENSE + +%% http-basic NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2014 Forbes Lindesay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF http-basic NOTICES, INFORMATION, AND LICENSE + +%% http-response-object NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2014 Forbes Lindesay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF http-response-object NOTICES, INFORMATION, AND LICENSE + +%% inflight NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF inflight NOTICES, INFORMATION, AND LICENSE + +%% inherits NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF inherits NOTICES, INFORMATION, AND LICENSE + +%% isarray NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +No license text available. +========================================= +END OF isarray NOTICES, INFORMATION, AND LICENSE + +%% minimatch NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF minimatch NOTICES, INFORMATION, AND LICENSE + +%% minimist NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF minimist NOTICES, INFORMATION, AND LICENSE + +%% mkdirp NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF mkdirp NOTICES, INFORMATION, AND LICENSE + +%% mocha NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +(The MIT License) + +Copyright (c) 2011-2018 JS Foundation and contributors, https://js.foundation + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF mocha NOTICES, INFORMATION, AND LICENSE + +%% mockery NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyrights for code authored by Yahoo! Inc. is licensed under the following + terms: + + MIT License + + Copyright (c) 2011 Yahoo! Inc. All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +========================================= +END OF mockery NOTICES, INFORMATION, AND LICENSE + +%% once NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF once NOTICES, INFORMATION, AND LICENSE + +%% path-is-absolute NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF path-is-absolute NOTICES, INFORMATION, AND LICENSE + +%% process-nextick-args NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +# Copyright (c) 2015 Calvin Metcalf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.** +========================================= +END OF process-nextick-args NOTICES, INFORMATION, AND LICENSE + +%% promise NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2014 Forbes Lindesay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF promise NOTICES, INFORMATION, AND LICENSE + +%% q NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2009–2017 Kristopher Michael Kowal. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +========================================= +END OF q NOTICES, INFORMATION, AND LICENSE + +%% qs NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2014 Nathan LaFreniere and other contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * The names of any contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + * * * + +The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors +========================================= +END OF qs NOTICES, INFORMATION, AND LICENSE + +%% readable-stream NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" +========================================= +END OF readable-stream NOTICES, INFORMATION, AND LICENSE + +%% safe-buffer NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF safe-buffer NOTICES, INFORMATION, AND LICENSE + +%% semver NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF semver NOTICES, INFORMATION, AND LICENSE + +%% shelljs NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2012, Artur Adib +All rights reserved. + +You may use this project under the terms of the New BSD license as follows: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Artur Adib nor the + names of the contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +========================================= +END OF shelljs NOTICES, INFORMATION, AND LICENSE + +%% string_decoder NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" +========================================= +END OF string_decoder NOTICES, INFORMATION, AND LICENSE + +%% sync-request NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2014 Forbes Lindesay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF sync-request NOTICES, INFORMATION, AND LICENSE + +%% then-request NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2014 Forbes Lindesay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF then-request NOTICES, INFORMATION, AND LICENSE + +%% typedarray NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +/* + Copyright (c) 2010, Linden Research, Inc. + Copyright (c) 2012, Joshua Bell + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + $/LicenseInfo$ + */ + +// Original can be found at: +// https://bitbucket.org/lindenlab/llsd +// Modifications by Joshua Bell inexorabletash@gmail.com +// https://github.com/inexorabletash/polyfill + +// ES3/ES5 implementation of the Krhonos Typed Array Specification +// Ref: http://www.khronos.org/registry/typedarray/specs/latest/ +// Date: 2011-02-01 +// +// Variations: +// * Allows typed_array.get/set() as alias for subscripts (typed_array[]) +========================================= +END OF typedarray NOTICES, INFORMATION, AND LICENSE + +%% typescript NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS +========================================= +END OF typescript NOTICES, INFORMATION, AND LICENSE + +%% util-deprecate NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF util-deprecate NOTICES, INFORMATION, AND LICENSE + +%% uuid NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) 2010-2016 Robert Kieffer and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +========================================= +END OF uuid NOTICES, INFORMATION, AND LICENSE + +%% wrappy NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF wrappy NOTICES, INFORMATION, AND LICENSE + diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/internal.d.ts b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/internal.d.ts new file mode 100644 index 0000000..3ae9d34 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/internal.d.ts @@ -0,0 +1,130 @@ +import vm = require('./vault'); +/** + * Hash table of known variable info. The formatted env var name is the lookup key. + * + * The purpose of this hash table is to keep track of known variables. The hash table + * needs to be maintained for multiple reasons: + * 1) to distinguish between env vars and job vars + * 2) to distinguish between secret vars and public + * 3) to know the real variable name and not just the formatted env var name. + */ +export declare var _knownVariableMap: { + [key: string]: _KnownVariableInfo; +}; +export declare var _vault: vm.Vault; +export declare function _startsWith(str: string, start: string): boolean; +export declare function _endsWith(str: string, end: string): boolean; +export declare function _writeLine(str: string): void; +export declare function _setStdStream(stdStream: any): void; +export declare function _setErrStream(errStream: any): void; +/** + * Sets the location of the resources json. This is typically the task.json file. + * Call once at the beginning of the script before any calls to loc. + * @param path Full path to the json. + * @param ignoreWarnings Won't throw warnings if path already set. + * @returns void + */ +export declare function _setResourcePath(path: string, ignoreWarnings?: boolean): void; +/** + * Gets the localized string from the json resource file. Optionally formats with additional params. + * + * @param key key of the resources string in the resource file + * @param param additional params for formatting the string + * @returns string + */ +export declare function _loc(key: string, ...param: any[]): string; +/** + * Gets a variable value that is defined on the build/release definition or set at runtime. + * + * @param name name of the variable to get + * @returns string + */ +export declare function _getVariable(name: string): string | undefined; +export declare function _getVariableKey(name: string): string; +/** + * Used to store the following information about job variables: + * 1) the real variable name (not the formatted environment variable name) + * 2) whether the variable is a secret variable + */ +export interface _KnownVariableInfo { + name: string; + secret: boolean; +} +export declare function _command(command: string, properties: any, message: string): void; +export declare function _warning(message: string): void; +export declare function _error(message: string): void; +export declare function _debug(message: string): void; +/** + * Returns whether a path exists. + * + * @param path path to check + * @returns boolean + */ +export declare function _exist(path: string): boolean; +/** + * Checks whether a path exists. + * If the path does not exist, it will throw. + * + * @param p path to check + * @param name name only used in error message to identify the path + * @returns void + */ +export declare function _checkPath(p: string, name: string): void; +/** + * Returns path of a tool had the tool actually been invoked. Resolves via paths. + * If you check and the tool does not exist, it will throw. + * + * @param tool name of the tool + * @param check whether to check if tool exists + * @returns string + */ +export declare function _which(tool: string, check?: boolean): string; +export declare function _legacyFindFiles_convertPatternToRegExp(pattern: string): RegExp; +export interface _MatchOptions { + debug?: boolean; + nobrace?: boolean; + noglobstar?: boolean; + dot?: boolean; + noext?: boolean; + nocase?: boolean; + nonull?: boolean; + matchBase?: boolean; + nocomment?: boolean; + nonegate?: boolean; + flipNegate?: boolean; +} +export declare function _cloneMatchOptions(matchOptions: _MatchOptions): _MatchOptions; +export interface _PatternFindInfo { + /** Adjusted pattern to use. Unrooted patterns are typically rooted using the default info, although this is not true for match-base scenarios. */ + adjustedPattern: string; + /** Path interpreted from the pattern to call find() on. */ + findPath: string; + /** Indicates whether to call stat() or find(). When all path segemnts in the pattern are literal, there is no need to call find(). */ + statOnly: boolean; +} +export declare function _getFindInfoFromPattern(defaultRoot: string, pattern: string, matchOptions: _MatchOptions): _PatternFindInfo; +export declare function _ensurePatternRooted(root: string, p: string): string; +export declare function _loadData(): void; +/** + * Defines if path is unc-path. + * + * @param path a path to a file. + * @returns true if path starts with double backslash, otherwise returns false. + */ +export declare function _isUncPath(path: string): boolean; +export declare function _ensureRooted(root: string, p: string): string; +/** + * Determines the parent path and trims trailing slashes (when safe). Path separators are normalized + * in the result. This function works similar to the .NET System.IO.Path.GetDirectoryName() method. + * For example, C:\hello\world\ returns C:\hello\world (trailing slash removed). Returns empty when + * no higher directory can be determined. + */ +export declare function _getDirectoryName(p: string): string; +/** + * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: + * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). + */ +export declare function _isRooted(p: string): boolean; +export declare function _normalizeSeparators(p: string): string; +export declare function _exposeProxySettings(): void; +export declare function _exposeCertSettings(): void; diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/internal.js b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/internal.js new file mode 100644 index 0000000..09e093a --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/internal.js @@ -0,0 +1,885 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports._exposeCertSettings = exports._exposeProxySettings = exports._normalizeSeparators = exports._isRooted = exports._getDirectoryName = exports._ensureRooted = exports._isUncPath = exports._loadData = exports._ensurePatternRooted = exports._getFindInfoFromPattern = exports._cloneMatchOptions = exports._legacyFindFiles_convertPatternToRegExp = exports._which = exports._checkPath = exports._exist = exports._debug = exports._error = exports._warning = exports._command = exports._getVariableKey = exports._getVariable = exports._loc = exports._setResourcePath = exports._setErrStream = exports._setStdStream = exports._writeLine = exports._endsWith = exports._startsWith = exports._vault = exports._knownVariableMap = void 0; +var fs = require("fs"); +var path = require("path"); +var os = require("os"); +var minimatch = require("minimatch"); +var util = require("util"); +var tcm = require("./taskcommand"); +var vm = require("./vault"); +var semver = require("semver"); +var crypto = require("crypto"); +/** + * Hash table of known variable info. The formatted env var name is the lookup key. + * + * The purpose of this hash table is to keep track of known variables. The hash table + * needs to be maintained for multiple reasons: + * 1) to distinguish between env vars and job vars + * 2) to distinguish between secret vars and public + * 3) to know the real variable name and not just the formatted env var name. + */ +exports._knownVariableMap = {}; +//----------------------------------------------------- +// Validation Checks +//----------------------------------------------------- +// async await needs generators in node 4.x+ +if (semver.lt(process.versions.node, '4.2.0')) { + _warning('Tasks require a new agent. Upgrade your agent or node to 4.2.0 or later'); +} +//----------------------------------------------------- +// String convenience +//----------------------------------------------------- +function _startsWith(str, start) { + return str.slice(0, start.length) == start; +} +exports._startsWith = _startsWith; +function _endsWith(str, end) { + return str.slice(-end.length) == end; +} +exports._endsWith = _endsWith; +//----------------------------------------------------- +// General Helpers +//----------------------------------------------------- +var _outStream = process.stdout; +var _errStream = process.stderr; +function _writeLine(str) { + _outStream.write(str + os.EOL); +} +exports._writeLine = _writeLine; +function _setStdStream(stdStream) { + _outStream = stdStream; +} +exports._setStdStream = _setStdStream; +function _setErrStream(errStream) { + _errStream = errStream; +} +exports._setErrStream = _setErrStream; +//----------------------------------------------------- +// Loc Helpers +//----------------------------------------------------- +var _locStringCache = {}; +var _resourceFiles = {}; +var _libResourceFileLoaded = false; +var _resourceCulture = 'en-US'; +function _loadResJson(resjsonFile) { + var resJson; + if (_exist(resjsonFile)) { + var resjsonContent = fs.readFileSync(resjsonFile, 'utf8').toString(); + // remove BOM + if (resjsonContent.indexOf('\uFEFF') == 0) { + resjsonContent = resjsonContent.slice(1); + } + try { + resJson = JSON.parse(resjsonContent); + } + catch (err) { + _debug('unable to parse resjson with err: ' + err.message); + } + } + else { + _debug('.resjson file not found: ' + resjsonFile); + } + return resJson; +} +function _loadLocStrings(resourceFile, culture) { + var locStrings = {}; + if (_exist(resourceFile)) { + var resourceJson = require(resourceFile); + if (resourceJson && resourceJson.hasOwnProperty('messages')) { + var locResourceJson; + // load up resource resjson for different culture + var localizedResourceFile = path.join(path.dirname(resourceFile), 'Strings', 'resources.resjson'); + var upperCulture = culture.toUpperCase(); + var cultures = []; + try { + cultures = fs.readdirSync(localizedResourceFile); + } + catch (ex) { } + for (var i = 0; i < cultures.length; i++) { + if (cultures[i].toUpperCase() == upperCulture) { + localizedResourceFile = path.join(localizedResourceFile, cultures[i], 'resources.resjson'); + if (_exist(localizedResourceFile)) { + locResourceJson = _loadResJson(localizedResourceFile); + } + break; + } + } + for (var key in resourceJson.messages) { + if (locResourceJson && locResourceJson.hasOwnProperty('loc.messages.' + key)) { + locStrings[key] = locResourceJson['loc.messages.' + key]; + } + else { + locStrings[key] = resourceJson.messages[key]; + } + } + } + } + else { + _warning('LIB_ResourceFile does not exist'); + } + return locStrings; +} +/** + * Sets the location of the resources json. This is typically the task.json file. + * Call once at the beginning of the script before any calls to loc. + * @param path Full path to the json. + * @param ignoreWarnings Won't throw warnings if path already set. + * @returns void + */ +function _setResourcePath(path, ignoreWarnings) { + if (ignoreWarnings === void 0) { ignoreWarnings = false; } + if (process.env['TASKLIB_INPROC_UNITS']) { + _resourceFiles = {}; + _libResourceFileLoaded = false; + _locStringCache = {}; + _resourceCulture = 'en-US'; + } + if (!_resourceFiles[path]) { + _checkPath(path, 'resource file path'); + _resourceFiles[path] = path; + _debug('adding resource file: ' + path); + _resourceCulture = _getVariable('system.culture') || _resourceCulture; + var locStrs = _loadLocStrings(path, _resourceCulture); + for (var key in locStrs) { + //cache loc string + _locStringCache[key] = locStrs[key]; + } + } + else { + if (ignoreWarnings) { + _debug(_loc('LIB_ResourceFileAlreadySet', path)); + } + else { + _warning(_loc('LIB_ResourceFileAlreadySet', path)); + } + } +} +exports._setResourcePath = _setResourcePath; +/** + * Gets the localized string from the json resource file. Optionally formats with additional params. + * + * @param key key of the resources string in the resource file + * @param param additional params for formatting the string + * @returns string + */ +function _loc(key) { + var param = []; + for (var _i = 1; _i < arguments.length; _i++) { + param[_i - 1] = arguments[_i]; + } + if (!_libResourceFileLoaded) { + // merge loc strings from azure-pipelines-task-lib. + var libResourceFile = path.join(__dirname, 'lib.json'); + var libLocStrs = _loadLocStrings(libResourceFile, _resourceCulture); + for (var libKey in libLocStrs) { + //cache azure-pipelines-task-lib loc string + _locStringCache[libKey] = libLocStrs[libKey]; + } + _libResourceFileLoaded = true; + } + var locString; + ; + if (_locStringCache.hasOwnProperty(key)) { + locString = _locStringCache[key]; + } + else { + if (Object.keys(_resourceFiles).length <= 0) { + _warning("Resource file haven't been set, can't find loc string for key: " + key); + } + else { + _warning("Can't find loc string for key: " + key); + } + locString = key; + } + if (param.length > 0) { + return util.format.apply(this, [locString].concat(param)); + } + else { + return locString; + } +} +exports._loc = _loc; +//----------------------------------------------------- +// Input Helpers +//----------------------------------------------------- +/** + * Gets a variable value that is defined on the build/release definition or set at runtime. + * + * @param name name of the variable to get + * @returns string + */ +function _getVariable(name) { + var varval; + // get the metadata + var info; + var key = _getVariableKey(name); + if (exports._knownVariableMap.hasOwnProperty(key)) { + info = exports._knownVariableMap[key]; + } + if (info && info.secret) { + // get the secret value + varval = exports._vault.retrieveSecret('SECRET_' + key); + } + else { + // get the public value + varval = process.env[key]; + // fallback for pre 2.104.1 agent + if (!varval && name.toUpperCase() == 'AGENT.JOBSTATUS') { + varval = process.env['agent.jobstatus']; + } + } + _debug(name + '=' + varval); + return varval; +} +exports._getVariable = _getVariable; +function _getVariableKey(name) { + if (!name) { + throw new Error(_loc('LIB_ParameterIsRequired', 'name')); + } + return name.replace(/\./g, '_').replace(/ /g, '_').toUpperCase(); +} +exports._getVariableKey = _getVariableKey; +//----------------------------------------------------- +// Cmd Helpers +//----------------------------------------------------- +function _command(command, properties, message) { + var taskCmd = new tcm.TaskCommand(command, properties, message); + _writeLine(taskCmd.toString()); +} +exports._command = _command; +function _warning(message) { + _command('task.issue', { 'type': 'warning' }, message); +} +exports._warning = _warning; +function _error(message) { + _command('task.issue', { 'type': 'error' }, message); +} +exports._error = _error; +function _debug(message) { + _command('task.debug', null, message); +} +exports._debug = _debug; +// //----------------------------------------------------- +// // Disk Functions +// //----------------------------------------------------- +/** + * Returns whether a path exists. + * + * @param path path to check + * @returns boolean + */ +function _exist(path) { + var exist = false; + try { + exist = !!(path && fs.statSync(path) != null); + } + catch (err) { + if (err && err.code === 'ENOENT') { + exist = false; + } + else { + throw err; + } + } + return exist; +} +exports._exist = _exist; +/** + * Checks whether a path exists. + * If the path does not exist, it will throw. + * + * @param p path to check + * @param name name only used in error message to identify the path + * @returns void + */ +function _checkPath(p, name) { + _debug('check path : ' + p); + if (!_exist(p)) { + throw new Error(_loc('LIB_PathNotFound', name, p)); + } +} +exports._checkPath = _checkPath; +/** + * Returns path of a tool had the tool actually been invoked. Resolves via paths. + * If you check and the tool does not exist, it will throw. + * + * @param tool name of the tool + * @param check whether to check if tool exists + * @returns string + */ +function _which(tool, check) { + if (!tool) { + throw new Error('parameter \'tool\' is required'); + } + // recursive when check=true + if (check) { + var result = _which(tool, false); + if (result) { + return result; + } + else { + if (process.platform == 'win32') { + throw new Error(_loc('LIB_WhichNotFound_Win', tool)); + } + else { + throw new Error(_loc('LIB_WhichNotFound_Linux', tool)); + } + } + } + _debug("which '" + tool + "'"); + try { + // build the list of extensions to try + var extensions = []; + if (process.platform == 'win32' && process.env['PATHEXT']) { + for (var _i = 0, _a = process.env['PATHEXT'].split(path.delimiter); _i < _a.length; _i++) { + var extension = _a[_i]; + if (extension) { + extensions.push(extension); + } + } + } + // if it's rooted, return it if exists. otherwise return empty. + if (_isRooted(tool)) { + var filePath = _tryGetExecutablePath(tool, extensions); + if (filePath) { + _debug("found: '" + filePath + "'"); + return filePath; + } + _debug('not found'); + return ''; + } + // if any path separators, return empty + if (tool.indexOf('/') >= 0 || (process.platform == 'win32' && tool.indexOf('\\') >= 0)) { + _debug('not found'); + return ''; + } + // build the list of directories + // + // Note, technically "where" checks the current directory on Windows. From a task lib perspective, + // it feels like we should not do this. Checking the current directory seems like more of a use + // case of a shell, and the which() function exposed by the task lib should strive for consistency + // across platforms. + var directories = []; + if (process.env['PATH']) { + for (var _b = 0, _c = process.env['PATH'].split(path.delimiter); _b < _c.length; _b++) { + var p = _c[_b]; + if (p) { + directories.push(p); + } + } + } + // return the first match + for (var _d = 0, directories_1 = directories; _d < directories_1.length; _d++) { + var directory = directories_1[_d]; + var filePath = _tryGetExecutablePath(directory + path.sep + tool, extensions); + if (filePath) { + _debug("found: '" + filePath + "'"); + return filePath; + } + } + _debug('not found'); + return ''; + } + catch (err) { + throw new Error(_loc('LIB_OperationFailed', 'which', err.message)); + } +} +exports._which = _which; +/** + * Best effort attempt to determine whether a file exists and is executable. + * @param filePath file path to check + * @param extensions additional file extensions to try + * @return if file exists and is executable, returns the file path. otherwise empty string. + */ +function _tryGetExecutablePath(filePath, extensions) { + try { + // test file exists + var stats = fs.statSync(filePath); + if (stats.isFile()) { + if (process.platform == 'win32') { + // on Windows, test for valid extension + var isExecutable = false; + var fileName = path.basename(filePath); + var dotIndex = fileName.lastIndexOf('.'); + if (dotIndex >= 0) { + var upperExt_1 = fileName.substr(dotIndex).toUpperCase(); + if (extensions.some(function (validExt) { return validExt.toUpperCase() == upperExt_1; })) { + return filePath; + } + } + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + } + catch (err) { + if (err.code != 'ENOENT') { + _debug("Unexpected error attempting to determine if executable file exists '" + filePath + "': " + err); + } + } + // try each extension + var originalFilePath = filePath; + for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { + var extension = extensions_1[_i]; + var found = false; + var filePath_1 = originalFilePath + extension; + try { + var stats = fs.statSync(filePath_1); + if (stats.isFile()) { + if (process.platform == 'win32') { + // preserve the case of the actual file (since an extension was appended) + try { + var directory = path.dirname(filePath_1); + var upperName = path.basename(filePath_1).toUpperCase(); + for (var _a = 0, _b = fs.readdirSync(directory); _a < _b.length; _a++) { + var actualName = _b[_a]; + if (upperName == actualName.toUpperCase()) { + filePath_1 = path.join(directory, actualName); + break; + } + } + } + catch (err) { + _debug("Unexpected error attempting to determine the actual case of the file '" + filePath_1 + "': " + err); + } + return filePath_1; + } + else { + if (isUnixExecutable(stats)) { + return filePath_1; + } + } + } + } + catch (err) { + if (err.code != 'ENOENT') { + _debug("Unexpected error attempting to determine if executable file exists '" + filePath_1 + "': " + err); + } + } + } + return ''; +} +// on Mac/Linux, test the execute bit +// R W X R W X R W X +// 256 128 64 32 16 8 4 2 1 +function isUnixExecutable(stats) { + return (stats.mode & 1) > 0 || ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || ((stats.mode & 64) > 0 && stats.uid === process.getuid()); +} +function _legacyFindFiles_convertPatternToRegExp(pattern) { + pattern = (process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern) // normalize separator on Windows + .replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&') // regex escape - from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript + .replace(/\\\/\\\*\\\*\\\//g, '((\/.+/)|(\/))') // replace directory globstar, e.g. /hello/**/world + .replace(/\\\*\\\*/g, '.*') // replace remaining globstars with a wildcard that can span directory separators, e.g. /hello/**dll + .replace(/\\\*/g, '[^\/]*') // replace asterisks with a wildcard that cannot span directory separators, e.g. /hello/*.dll + .replace(/\\\?/g, '[^\/]'); // replace single character wildcards, e.g. /hello/log?.dll + pattern = "^" + pattern + "$"; + var flags = process.platform == 'win32' ? 'i' : ''; + return new RegExp(pattern, flags); +} +exports._legacyFindFiles_convertPatternToRegExp = _legacyFindFiles_convertPatternToRegExp; +function _cloneMatchOptions(matchOptions) { + return { + debug: matchOptions.debug, + nobrace: matchOptions.nobrace, + noglobstar: matchOptions.noglobstar, + dot: matchOptions.dot, + noext: matchOptions.noext, + nocase: matchOptions.nocase, + nonull: matchOptions.nonull, + matchBase: matchOptions.matchBase, + nocomment: matchOptions.nocomment, + nonegate: matchOptions.nonegate, + flipNegate: matchOptions.flipNegate + }; +} +exports._cloneMatchOptions = _cloneMatchOptions; +function _getFindInfoFromPattern(defaultRoot, pattern, matchOptions) { + // parameter validation + if (!defaultRoot) { + throw new Error('getFindRootFromPattern() parameter defaultRoot cannot be empty'); + } + if (!pattern) { + throw new Error('getFindRootFromPattern() parameter pattern cannot be empty'); + } + if (!matchOptions.nobrace) { + throw new Error('getFindRootFromPattern() expected matchOptions.nobrace to be true'); + } + // for the sake of determining the findPath, pretend nocase=false + matchOptions = _cloneMatchOptions(matchOptions); + matchOptions.nocase = false; + // check if basename only and matchBase=true + if (matchOptions.matchBase && + !_isRooted(pattern) && + (process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern).indexOf('/') < 0) { + return { + adjustedPattern: pattern, + findPath: defaultRoot, + statOnly: false, + }; + } + // the technique applied by this function is to use the information on the Minimatch object determine + // the findPath. Minimatch breaks the pattern into path segments, and exposes information about which + // segments are literal vs patterns. + // + // note, the technique currently imposes a limitation for drive-relative paths with a glob in the + // first segment, e.g. C:hello*/world. it's feasible to overcome this limitation, but is left unsolved + // for now. + var minimatchObj = new minimatch.Minimatch(pattern, matchOptions); + // the "set" property is an array of arrays of parsed path segment info. the outer array should only + // contain one item, otherwise something went wrong. brace expansion can result in multiple arrays, + // but that should be turned off by the time this function is reached. + if (minimatchObj.set.length != 1) { + throw new Error('getFindRootFromPattern() expected Minimatch(...).set.length to be 1. Actual: ' + minimatchObj.set.length); + } + var literalSegments = []; + for (var _i = 0, _a = minimatchObj.set[0]; _i < _a.length; _i++) { + var parsedSegment = _a[_i]; + if (typeof parsedSegment == 'string') { + // the item is a string when the original input for the path segment does not contain any + // unescaped glob characters. + // + // note, the string here is already unescaped (i.e. glob escaping removed), so it is ready + // to pass to find() as-is. for example, an input string 'hello\\*world' => 'hello*world'. + literalSegments.push(parsedSegment); + continue; + } + break; + } + // join the literal segments back together. Minimatch converts '\' to '/' on Windows, then squashes + // consequetive slashes, and finally splits on slash. this means that UNC format is lost, but can + // be detected from the original pattern. + var joinedSegments = literalSegments.join('/'); + if (joinedSegments && process.platform == 'win32' && _startsWith(pattern.replace(/\\/g, '/'), '//')) { + joinedSegments = '/' + joinedSegments; // restore UNC format + } + // determine the find path + var findPath; + if (_isRooted(pattern)) { // the pattern was rooted + findPath = joinedSegments; + } + else if (joinedSegments) { // the pattern was not rooted, and literal segments were found + findPath = _ensureRooted(defaultRoot, joinedSegments); + } + else { // the pattern was not rooted, and no literal segments were found + findPath = defaultRoot; + } + // clean up the path + if (findPath) { + findPath = _getDirectoryName(_ensureRooted(findPath, '_')); // hack to remove unnecessary trailing slash + findPath = _normalizeSeparators(findPath); // normalize slashes + } + return { + adjustedPattern: _ensurePatternRooted(defaultRoot, pattern), + findPath: findPath, + statOnly: literalSegments.length == minimatchObj.set[0].length, + }; +} +exports._getFindInfoFromPattern = _getFindInfoFromPattern; +function _ensurePatternRooted(root, p) { + if (!root) { + throw new Error('ensurePatternRooted() parameter "root" cannot be empty'); + } + if (!p) { + throw new Error('ensurePatternRooted() parameter "p" cannot be empty'); + } + if (_isRooted(p)) { + return p; + } + // normalize root + root = _normalizeSeparators(root); + // escape special glob characters + root = (process.platform == 'win32' ? root : root.replace(/\\/g, '\\\\')) // escape '\' on OSX/Linux + .replace(/(\[)(?=[^\/]+\])/g, '[[]') // escape '[' when ']' follows within the path segment + .replace(/\?/g, '[?]') // escape '?' + .replace(/\*/g, '[*]') // escape '*' + .replace(/\+\(/g, '[+](') // escape '+(' + .replace(/@\(/g, '[@](') // escape '@(' + .replace(/!\(/g, '[!]('); // escape '!(' + return _ensureRooted(root, p); +} +exports._ensurePatternRooted = _ensurePatternRooted; +//------------------------------------------------------------------- +// Populate the vault with sensitive data. Inputs and Endpoints +//------------------------------------------------------------------- +function _loadData() { + // in agent, prefer TempDirectory then workFolder. + // In interactive dev mode, it won't be + var keyPath = _getVariable("agent.TempDirectory") || _getVariable("agent.workFolder") || process.cwd(); + exports._vault = new vm.Vault(keyPath); + exports._knownVariableMap = {}; + _debug('loading inputs and endpoints'); + var loaded = 0; + for (var envvar in process.env) { + if (_startsWith(envvar, 'INPUT_') || + _startsWith(envvar, 'ENDPOINT_AUTH_') || + _startsWith(envvar, 'SECUREFILE_TICKET_') || + _startsWith(envvar, 'SECRET_') || + _startsWith(envvar, 'VSTS_TASKVARIABLE_')) { + // Record the secret variable metadata. This is required by getVariable to know whether + // to retrieve the value from the vault. In a 2.104.1 agent or higher, this metadata will + // be overwritten when the VSTS_SECRET_VARIABLES env var is processed below. + if (_startsWith(envvar, 'SECRET_')) { + var variableName = envvar.substring('SECRET_'.length); + if (variableName) { + // This is technically not the variable name (has underscores instead of dots), + // but it's good enough to make getVariable work in a pre-2.104.1 agent where + // the VSTS_SECRET_VARIABLES env var is not defined. + exports._knownVariableMap[_getVariableKey(variableName)] = { name: variableName, secret: true }; + } + } + // store the secret + var value = process.env[envvar]; + if (value) { + ++loaded; + _debug('loading ' + envvar); + exports._vault.storeSecret(envvar, value); + delete process.env[envvar]; + } + } + } + _debug('loaded ' + loaded); + // store public variable metadata + var names; + try { + names = JSON.parse(process.env['VSTS_PUBLIC_VARIABLES'] || '[]'); + } + catch (err) { + throw new Error('Failed to parse VSTS_PUBLIC_VARIABLES as JSON. ' + err); // may occur during interactive testing + } + names.forEach(function (name) { + exports._knownVariableMap[_getVariableKey(name)] = { name: name, secret: false }; + }); + delete process.env['VSTS_PUBLIC_VARIABLES']; + // store secret variable metadata + try { + names = JSON.parse(process.env['VSTS_SECRET_VARIABLES'] || '[]'); + } + catch (err) { + throw new Error('Failed to parse VSTS_SECRET_VARIABLES as JSON. ' + err); // may occur during interactive testing + } + names.forEach(function (name) { + exports._knownVariableMap[_getVariableKey(name)] = { name: name, secret: true }; + }); + delete process.env['VSTS_SECRET_VARIABLES']; + // avoid loading twice (overwrites .taskkey) + global['_vsts_task_lib_loaded'] = true; +} +exports._loadData = _loadData; +//-------------------------------------------------------------------------------- +// Internal path helpers. +//-------------------------------------------------------------------------------- +/** + * Defines if path is unc-path. + * + * @param path a path to a file. + * @returns true if path starts with double backslash, otherwise returns false. + */ +function _isUncPath(path) { + return /^\\\\[^\\]/.test(path); +} +exports._isUncPath = _isUncPath; +function _ensureRooted(root, p) { + if (!root) { + throw new Error('ensureRooted() parameter "root" cannot be empty'); + } + if (!p) { + throw new Error('ensureRooted() parameter "p" cannot be empty'); + } + if (_isRooted(p)) { + return p; + } + if (process.platform == 'win32' && root.match(/^[A-Z]:$/i)) { // e.g. C: + return root + p; + } + // ensure root ends with a separator + if (_endsWith(root, '/') || (process.platform == 'win32' && _endsWith(root, '\\'))) { + // root already ends with a separator + } + else { + root += path.sep; // append separator + } + return root + p; +} +exports._ensureRooted = _ensureRooted; +/** + * Determines the parent path and trims trailing slashes (when safe). Path separators are normalized + * in the result. This function works similar to the .NET System.IO.Path.GetDirectoryName() method. + * For example, C:\hello\world\ returns C:\hello\world (trailing slash removed). Returns empty when + * no higher directory can be determined. + */ +function _getDirectoryName(p) { + // short-circuit if empty + if (!p) { + return ''; + } + // normalize separators + p = _normalizeSeparators(p); + // on Windows, the goal of this function is to match the behavior of + // [System.IO.Path]::GetDirectoryName(), e.g. + // C:/ => + // C:/hello => C:\ + // C:/hello/ => C:\hello + // C:/hello/world => C:\hello + // C:/hello/world/ => C:\hello\world + // C: => + // C:hello => C: + // C:hello/ => C:hello + // / => + // /hello => \ + // /hello/ => \hello + // //hello => + // //hello/ => + // //hello/world => + // //hello/world/ => \\hello\world + // + // unfortunately, path.dirname() can't simply be used. for example, on Windows + // it yields different results from Path.GetDirectoryName: + // C:/ => C:/ + // C:/hello => C:/ + // C:/hello/ => C:/ + // C:/hello/world => C:/hello + // C:/hello/world/ => C:/hello + // C: => C: + // C:hello => C: + // C:hello/ => C: + // / => / + // /hello => / + // /hello/ => / + // //hello => / + // //hello/ => / + // //hello/world => //hello/world + // //hello/world/ => //hello/world/ + // //hello/world/again => //hello/world/ + // //hello/world/again/ => //hello/world/ + // //hello/world/again/again => //hello/world/again + // //hello/world/again/again/ => //hello/world/again + if (process.platform == 'win32') { + if (/^[A-Z]:\\?[^\\]+$/i.test(p)) { // e.g. C:\hello or C:hello + return p.charAt(2) == '\\' ? p.substring(0, 3) : p.substring(0, 2); + } + else if (/^[A-Z]:\\?$/i.test(p)) { // e.g. C:\ or C: + return ''; + } + var lastSlashIndex = p.lastIndexOf('\\'); + if (lastSlashIndex < 0) { // file name only + return ''; + } + else if (p == '\\') { // relative root + return ''; + } + else if (lastSlashIndex == 0) { // e.g. \\hello + return '\\'; + } + else if (/^\\\\[^\\]+(\\[^\\]*)?$/.test(p)) { // UNC root, e.g. \\hello or \\hello\ or \\hello\world + return ''; + } + return p.substring(0, lastSlashIndex); // e.g. hello\world => hello or hello\world\ => hello\world + // note, this means trailing slashes for non-root directories + // (i.e. not C:\, \, or \\unc\) will simply be removed. + } + // OSX/Linux + if (p.indexOf('/') < 0) { // file name only + return ''; + } + else if (p == '/') { + return ''; + } + else if (_endsWith(p, '/')) { + return p.substring(0, p.length - 1); + } + return path.dirname(p); +} +exports._getDirectoryName = _getDirectoryName; +/** + * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: + * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). + */ +function _isRooted(p) { + p = _normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); + } + if (process.platform == 'win32') { + return _startsWith(p, '\\') || // e.g. \ or \hello or \\hello + /^[A-Z]:/i.test(p); // e.g. C: or C:\hello + } + return _startsWith(p, '/'); // e.g. /hello +} +exports._isRooted = _isRooted; +function _normalizeSeparators(p) { + p = p || ''; + if (process.platform == 'win32') { + // convert slashes on Windows + p = p.replace(/\//g, '\\'); + // remove redundant slashes + var isUnc = /^\\\\+[^\\]/.test(p); // e.g. \\hello + return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\'); // preserve leading // for UNC + } + // remove redundant slashes + return p.replace(/\/\/+/g, '/'); +} +exports._normalizeSeparators = _normalizeSeparators; +//----------------------------------------------------- +// Expose proxy information to vsts-node-api +//----------------------------------------------------- +function _exposeProxySettings() { + var proxyUrl = _getVariable('Agent.ProxyUrl'); + if (proxyUrl && proxyUrl.length > 0) { + var proxyUsername = _getVariable('Agent.ProxyUsername'); + var proxyPassword = _getVariable('Agent.ProxyPassword'); + var proxyBypassHostsJson = _getVariable('Agent.ProxyBypassList'); + global['_vsts_task_lib_proxy_url'] = proxyUrl; + global['_vsts_task_lib_proxy_username'] = proxyUsername; + global['_vsts_task_lib_proxy_bypass'] = proxyBypassHostsJson; + global['_vsts_task_lib_proxy_password'] = _exposeTaskLibSecret('proxy', proxyPassword || ''); + _debug('expose agent proxy configuration.'); + global['_vsts_task_lib_proxy'] = true; + } +} +exports._exposeProxySettings = _exposeProxySettings; +//----------------------------------------------------- +// Expose certificate information to vsts-node-api +//----------------------------------------------------- +function _exposeCertSettings() { + var ca = _getVariable('Agent.CAInfo'); + if (ca) { + global['_vsts_task_lib_cert_ca'] = ca; + } + var clientCert = _getVariable('Agent.ClientCert'); + if (clientCert) { + var clientCertKey = _getVariable('Agent.ClientCertKey'); + var clientCertArchive = _getVariable('Agent.ClientCertArchive'); + var clientCertPassword = _getVariable('Agent.ClientCertPassword'); + global['_vsts_task_lib_cert_clientcert'] = clientCert; + global['_vsts_task_lib_cert_key'] = clientCertKey; + global['_vsts_task_lib_cert_archive'] = clientCertArchive; + global['_vsts_task_lib_cert_passphrase'] = _exposeTaskLibSecret('cert', clientCertPassword || ''); + } + if (ca || clientCert) { + _debug('expose agent certificate configuration.'); + global['_vsts_task_lib_cert'] = true; + } + var skipCertValidation = _getVariable('Agent.SkipCertValidation') || 'false'; + if (skipCertValidation) { + global['_vsts_task_lib_skip_cert_validation'] = skipCertValidation.toUpperCase() === 'TRUE'; + } +} +exports._exposeCertSettings = _exposeCertSettings; +// We store the encryption key on disk and hold the encrypted content and key file in memory +// return base64encoded:base64encoded +// downstream vsts-node-api will retrieve the secret later +function _exposeTaskLibSecret(keyFile, secret) { + if (secret) { + var encryptKey = crypto.randomBytes(256); + var cipher = crypto.createCipher("aes-256-ctr", encryptKey); + var encryptedContent = cipher.update(secret, "utf8", "hex"); + encryptedContent += cipher.final("hex"); + var storageFile = path.join(_getVariable('Agent.TempDirectory') || _getVariable("agent.workFolder") || process.cwd(), keyFile); + fs.writeFileSync(storageFile, encryptKey.toString('base64'), { encoding: 'utf8' }); + return new Buffer(storageFile).toString('base64') + ':' + new Buffer(encryptedContent).toString('base64'); + } +} diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/lib.json b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/lib.json new file mode 100644 index 0000000..333fa14 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/lib.json @@ -0,0 +1,37 @@ +{ + "messages": { + "LIB_UnhandledEx": "Unhandled: %s", + "LIB_FailOnCode": "Failure return code: %d", + "LIB_MkdirFailed": "Unable to create directory '%s'. %s", + "LIB_MkdirFailedFileExists": "Unable to create directory '%s'. Conflicting file exists: '%s'", + "LIB_MkdirFailedInvalidDriveRoot": "Unable to create directory '%s'. Root directory does not exist: '%s'", + "LIB_MkdirFailedInvalidShare": "Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.", + "LIB_MultilineSecret": "Secrets cannot contain multiple lines", + "LIB_ProcessError": "There was an error when attempting to execute the process '%s'. This may indicate the process failed to start. Error: %s", + "LIB_ProcessExitCode": "The process '%s' failed with exit code %s", + "LIB_ProcessStderr": "The process '%s' failed because one or more lines were written to the STDERR stream", + "LIB_ReturnCode": "Return code: %d", + "LIB_ResourceFileNotExist": "Resource file doesn\\'t exist: %s", + "LIB_ResourceFileAlreadySet": "Resource file has already set to: %s", + "LIB_ResourceFileNotSet": "Resource file haven\\'t set, can\\'t find loc string for key: %s", + "LIB_StdioNotClosed": "The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.", + "LIB_WhichNotFound_Linux": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.", + "LIB_WhichNotFound_Win": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.", + "LIB_LocStringNotFound": "Can\\'t find loc string for key: %s", + "LIB_ParameterIsRequired": "%s not supplied", + "LIB_InputRequired": "Input required: %s", + "LIB_InvalidPattern": "Invalid pattern: '%s'", + "LIB_EndpointNotExist": "Endpoint not present: %s", + "LIB_EndpointDataNotExist": "Endpoint data parameter %s not present: %s", + "LIB_EndpointAuthNotExist": "Endpoint auth data not present: %s", + "LIB_InvalidEndpointAuth": "Invalid endpoint auth: %s", + "LIB_InvalidSecureFilesInput": "Invalid secure file input: %s", + "LIB_PathNotFound": "Not found %s: %s", + "LIB_PathHasNullByte": "Path cannot contain null bytes", + "LIB_OperationFailed": "Failed %s: %s", + "LIB_UseFirstGlobMatch": "Multiple workspace matches. using first.", + "LIB_MergeTestResultNotSupported": "Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.", + "LIB_PlatformNotSupported": "Platform not supported: %s", + "LIB_CopyFileFailed": "Error while copying the file. Attempts left: %s" + } +} diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-answer.d.ts b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-answer.d.ts new file mode 100644 index 0000000..e06bccc --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-answer.d.ts @@ -0,0 +1,55 @@ +import * as task from './task'; +export interface TaskLibAnswerExecResult { + code: number; + stdout?: string; + stderr?: string; +} +export interface TaskLibAnswers { + checkPath?: { + [key: string]: boolean; + }; + cwd?: { + [key: string]: string; + }; + exec?: { + [key: string]: TaskLibAnswerExecResult; + }; + exist?: { + [key: string]: boolean; + }; + find?: { + [key: string]: string[]; + }; + findMatch?: { + [key: string]: string[]; + }; + getPlatform?: { + [key: string]: task.Platform; + }; + legacyFindFiles?: { + [key: string]: string[]; + }; + ls?: { + [key: string]: string; + }; + osType?: { + [key: string]: string; + }; + rmRF?: { + [key: string]: { + success: boolean; + }; + }; + stats?: { + [key: string]: any; + }; + which?: { + [key: string]: string; + }; +} +export declare type MockedCommand = keyof TaskLibAnswers; +export declare class MockAnswers { + private _answers; + initialize(answers: TaskLibAnswers): void; + getResponse(cmd: MockedCommand, key: string, debug: (message: string) => void): any; +} diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-answer.js b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-answer.js new file mode 100644 index 0000000..f817096 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-answer.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MockAnswers = void 0; +var MockAnswers = /** @class */ (function () { + function MockAnswers() { + } + MockAnswers.prototype.initialize = function (answers) { + if (!answers) { + throw new Error('Answers not supplied'); + } + this._answers = answers; + }; + MockAnswers.prototype.getResponse = function (cmd, key, debug) { + debug("looking up mock answers for " + JSON.stringify(cmd) + ", key '" + JSON.stringify(key) + "'"); + if (!this._answers) { + throw new Error('Must initialize'); + } + if (!this._answers[cmd]) { + debug("no mock responses registered for " + JSON.stringify(cmd)); + return null; + } + var cmd_answer = this._answers[cmd]; + //use this construction to avoid falsy zero + if (cmd_answer[key] != null) { + debug('found mock response'); + return cmd_answer[key]; + } + if (key && process.env['MOCK_NORMALIZE_SLASHES'] === 'true') { + // try normalizing the slashes + var key2 = key.replace(/\\/g, "/"); + if (cmd_answer[key2]) { + debug('found mock response for normalized key'); + return cmd_answer[key2]; + } + } + debug('mock response not found'); + return null; + }; + return MockAnswers; +}()); +exports.MockAnswers = MockAnswers; diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-run.d.ts b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-run.d.ts new file mode 100644 index 0000000..c3d3972 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-run.d.ts @@ -0,0 +1,44 @@ +import ma = require('./mock-answer'); +export declare class TaskMockRunner { + constructor(taskPath: string); + _taskPath: string; + _answers: ma.TaskLibAnswers | undefined; + _exports: { + [key: string]: any; + }; + _moduleCount: number; + setInput(name: string, val: string): void; + setVariableName(name: string, val: string, isSecret?: boolean): void; + /** + * Register answers for the mock "azure-pipelines-task-lib/task" instance. + * + * @param answers Answers to be returned when the task lib functions are called. + */ + setAnswers(answers: ma.TaskLibAnswers): void; + /** + * Register a mock module. When require() is called for the module name, + * the mock implementation will be returned instead. + * + * @param modName Module name to override. + * @param val Mock implementation of the module. + * @returns void + */ + registerMock(modName: string, mod: any): void; + /** + * Registers an override for a specific function on the mock "azure-pipelines-task-lib/task" instance. + * This can be used in conjunction with setAnswers(), for cases where additional runtime + * control is needed for a specific function. + * + * @param key Function or field to override. + * @param val Function or field value. + * @returns void + */ + registerMockExport(key: string, val: any): void; + /** + * Runs a task script. + * + * @param noMockTask Indicates whether to mock "azure-pipelines-task-lib/task". Default is to mock. + * @returns void + */ + run(noMockTask?: boolean): void; +} diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-run.js b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-run.js new file mode 100644 index 0000000..ae27439 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-run.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TaskMockRunner = void 0; +var mockery = require("mockery"); +var im = require("./internal"); +var TaskMockRunner = /** @class */ (function () { + function TaskMockRunner(taskPath) { + this._exports = {}; + this._moduleCount = 0; + this._taskPath = taskPath; + } + TaskMockRunner.prototype.setInput = function (name, val) { + var key = im._getVariableKey(name); + process.env['INPUT_' + key] = val; + }; + TaskMockRunner.prototype.setVariableName = function (name, val, isSecret) { + var key = im._getVariableKey(name); + if (isSecret) { + process.env['SECRET_' + key] = val; + } + else { + process.env['VSTS_TASKVARIABLE_' + key] = val; + } + }; + /** + * Register answers for the mock "azure-pipelines-task-lib/task" instance. + * + * @param answers Answers to be returned when the task lib functions are called. + */ + TaskMockRunner.prototype.setAnswers = function (answers) { + this._answers = answers; + }; + /** + * Register a mock module. When require() is called for the module name, + * the mock implementation will be returned instead. + * + * @param modName Module name to override. + * @param val Mock implementation of the module. + * @returns void + */ + TaskMockRunner.prototype.registerMock = function (modName, mod) { + this._moduleCount++; + mockery.registerMock(modName, mod); + }; + /** + * Registers an override for a specific function on the mock "azure-pipelines-task-lib/task" instance. + * This can be used in conjunction with setAnswers(), for cases where additional runtime + * control is needed for a specific function. + * + * @param key Function or field to override. + * @param val Function or field value. + * @returns void + */ + TaskMockRunner.prototype.registerMockExport = function (key, val) { + this._exports[key] = val; + }; + /** + * Runs a task script. + * + * @param noMockTask Indicates whether to mock "azure-pipelines-task-lib/task". Default is to mock. + * @returns void + */ + TaskMockRunner.prototype.run = function (noMockTask) { + var _this = this; + // determine whether to enable mockery + if (!noMockTask || this._moduleCount) { + mockery.enable({ warnOnUnregistered: false }); + } + // answers and exports not compatible with "noMockTask" mode + if (noMockTask) { + if (this._answers || Object.keys(this._exports).length) { + throw new Error('setAnswers() and registerMockExport() is not compatible with "noMockTask" mode'); + } + } + // register mock task lib + else { + var tlm = require('azure-pipelines-task-lib/mock-task'); + if (this._answers) { + tlm.setAnswers(this._answers); + } + Object.keys(this._exports) + .forEach(function (key) { + tlm[key] = _this._exports[key]; + }); + mockery.registerMock('azure-pipelines-task-lib/task', tlm); + } + // run it + require(this._taskPath); + }; + return TaskMockRunner; +}()); +exports.TaskMockRunner = TaskMockRunner; diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-task.d.ts b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-task.d.ts new file mode 100644 index 0000000..b5233c6 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-task.d.ts @@ -0,0 +1,111 @@ +/// +import Q = require('q'); +import fs = require('fs'); +import task = require('./task'); +import trm = require('./mock-toolrunner'); +import ma = require('./mock-answer'); +export declare function setAnswers(answers: ma.TaskLibAnswers): void; +export declare function setResourcePath(path: string): void; +export declare function loc(key: string, ...args: any[]): string; +export interface EndpointAuthorization { + parameters: { + [key: string]: string; + }; + scheme: string; +} +export declare class FsStats implements fs.Stats { + private m_isFile; + private m_isDirectory; + private m_isBlockDevice; + private m_isCharacterDevice; + private m_isSymbolicLink; + private m_isFIFO; + private m_isSocket; + dev: number; + ino: number; + mode: number; + nlink: number; + uid: number; + gid: number; + rdev: number; + size: number; + blksize: number; + blocks: number; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + atimeMs: number; + mtimeMs: number; + ctimeMs: number; + birthtimeMs: number; + setAnswers(mockResponses: any): void; + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; +} +export declare function stats(path: string): FsStats; +export declare function exist(path: string): boolean; +export interface FsOptions { + encoding?: string; + mode?: number; + flag?: string; +} +export declare function writeFile(file: string, data: string | Buffer, options?: string | FsOptions): void; +export declare function osType(): string; +export declare function getPlatform(): task.Platform; +export declare function cwd(): string; +export declare function cd(path: string): void; +export declare function pushd(path: string): void; +export declare function popd(): void; +export declare function checkPath(p: string, name: string): void; +export declare function mkdirP(p: any): void; +export declare function resolve(): string; +export declare function which(tool: string, check?: boolean): string; +export declare function ls(options: string, paths: string[]): string[]; +export declare function cp(source: string, dest: string): void; +export declare function retry(func: Function, args: any[], retryOptions: task.RetryOptions): any; +export declare function find(findPath: string): string[]; +export declare function rmRF(path: string): void; +export declare function mv(source: string, dest: string, force: boolean, continueOnError?: boolean): boolean; +export declare function exec(tool: string, args: any, options?: trm.IExecOptions): Q.Promise; +export declare function execSync(tool: string, args: any, options?: trm.IExecSyncOptions): trm.IExecSyncResult; +export declare function tool(tool: string): trm.ToolRunner; +export interface MatchOptions { + debug?: boolean; + nobrace?: boolean; + noglobstar?: boolean; + dot?: boolean; + noext?: boolean; + nocase?: boolean; + nonull?: boolean; + matchBase?: boolean; + nocomment?: boolean; + nonegate?: boolean; + flipNegate?: boolean; +} +export declare function findMatch(defaultRoot: string, patterns: string[] | string): string[]; +export declare function legacyFindFiles(rootDirectory: string, pattern: string, includeFiles?: boolean, includeDirectories?: boolean): string[]; +export declare class TestPublisher { + testRunner: string; + constructor(testRunner: string); + publish(resultFiles?: string, mergeResults?: string, platform?: string, config?: string, runTitle?: string, publishRunAttachments?: string): void; +} +export declare class CodeCoveragePublisher { + constructor(); + publish(codeCoverageTool?: string, summaryFileLocation?: string, reportDirectory?: string, additionalCodeCoverageFiles?: string): void; +} +export declare class CodeCoverageEnabler { + private buildTool; + private ccTool; + constructor(buildTool: string, ccTool: string); + enableCodeCoverage(buildProps: { + [key: string]: string; + }): void; +} +export declare function getHttpProxyConfiguration(requestUrl?: string): task.ProxyConfiguration | null; +export declare function getHttpCertConfiguration(): task.CertConfiguration | null; diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-task.js b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-task.js new file mode 100644 index 0000000..5703d41 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-task.js @@ -0,0 +1,447 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getHttpCertConfiguration = exports.getHttpProxyConfiguration = exports.CodeCoverageEnabler = exports.CodeCoveragePublisher = exports.TestPublisher = exports.legacyFindFiles = exports.findMatch = exports.tool = exports.execSync = exports.exec = exports.mv = exports.rmRF = exports.find = exports.retry = exports.cp = exports.ls = exports.which = exports.resolve = exports.mkdirP = exports.checkPath = exports.popd = exports.pushd = exports.cd = exports.cwd = exports.getPlatform = exports.osType = exports.writeFile = exports.exist = exports.stats = exports.FsStats = exports.loc = exports.setResourcePath = exports.setAnswers = void 0; +var path = require("path"); +var task = require("./task"); +var tcm = require("./taskcommand"); +var trm = require("./mock-toolrunner"); +var ma = require("./mock-answer"); +var mock = new ma.MockAnswers(); +function setAnswers(answers) { + mock.initialize(answers); + trm.setAnswers(answers); +} +exports.setAnswers = setAnswers; +//----------------------------------------------------- +// Enums +//----------------------------------------------------- +module.exports.TaskResult = task.TaskResult; +module.exports.TaskState = task.TaskState; +module.exports.IssueType = task.IssueType; +module.exports.ArtifactType = task.ArtifactType; +module.exports.FieldType = task.FieldType; +module.exports.Platform = task.Platform; +//----------------------------------------------------- +// Results and Exiting +//----------------------------------------------------- +module.exports.setStdStream = task.setStdStream; +module.exports.setErrStream = task.setErrStream; +module.exports.setResult = task.setResult; +//----------------------------------------------------- +// Loc Helpers +//----------------------------------------------------- +function setResourcePath(path) { + // nothing in mock +} +exports.setResourcePath = setResourcePath; +function loc(key) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + var str = 'loc_mock_' + key; + if (args.length) { + str += ' ' + args.join(' '); + } + return str; +} +exports.loc = loc; +//----------------------------------------------------- +// Input Helpers +//----------------------------------------------------- +module.exports.assertAgent = task.assertAgent; +module.exports.getVariable = task.getVariable; +module.exports.getVariables = task.getVariables; +module.exports.setVariable = task.setVariable; +module.exports.setSecret = task.setSecret; +module.exports.getTaskVariable = task.getTaskVariable; +module.exports.setTaskVariable = task.setTaskVariable; +module.exports.getInput = task.getInput; +module.exports.getInputRequired = task.getInputRequired; +module.exports.getBoolInput = task.getBoolInput; +module.exports.getDelimitedInput = task.getDelimitedInput; +module.exports.filePathSupplied = task.filePathSupplied; +function getPathInput(name, required, check) { + var inval = module.exports.getInput(name, required); + if (inval) { + if (check) { + checkPath(inval, name); + } + } + return inval; +} +module.exports.getPathInput = getPathInput; +function getPathInputRequired(name, check) { + return getPathInput(name, true, check); +} +module.exports.getPathInputRequired = getPathInputRequired; +//----------------------------------------------------- +// Endpoint Helpers +//----------------------------------------------------- +module.exports.getEndpointUrl = task.getEndpointUrl; +module.exports.getEndpointUrlRequired = task.getEndpointUrlRequired; +module.exports.getEndpointDataParameter = task.getEndpointDataParameter; +module.exports.getEndpointDataParameterRequired = task.getEndpointDataParameterRequired; +module.exports.getEndpointAuthorizationScheme = task.getEndpointAuthorizationScheme; +module.exports.getEndpointAuthorizationSchemeRequired = task.getEndpointAuthorizationSchemeRequired; +module.exports.getEndpointAuthorizationParameter = task.getEndpointAuthorizationParameter; +module.exports.getEndpointAuthorizationParameterRequired = task.getEndpointAuthorizationParameterRequired; +module.exports.getEndpointAuthorization = task.getEndpointAuthorization; +//----------------------------------------------------- +// SecureFile Helpers +//----------------------------------------------------- +module.exports.getSecureFileName = task.getSecureFileName; +module.exports.getSecureFileTicket = task.getSecureFileTicket; +//----------------------------------------------------- +// Fs Helpers +//----------------------------------------------------- +var FsStats = /** @class */ (function () { + function FsStats() { + this.m_isFile = false; + this.m_isDirectory = false; + this.m_isBlockDevice = false; + this.m_isCharacterDevice = false; + this.m_isSymbolicLink = false; + this.m_isFIFO = false; + this.m_isSocket = false; + this.dev = 0; + this.ino = 0; + this.mode = 0; + this.nlink = 0; + this.uid = 0; + this.gid = 0; + this.rdev = 0; + this.size = 0; + this.blksize = 0; + this.blocks = 0; + this.atime = new Date(); + this.mtime = new Date(); + this.ctime = new Date(); + this.birthtime = new Date(); + } + FsStats.prototype.setAnswers = function (mockResponses) { + this.m_isFile = mockResponses['isFile'] || this.m_isFile; + this.m_isDirectory = mockResponses['isDirectory'] || this.m_isDirectory; + this.m_isBlockDevice = mockResponses['isBlockDevice'] || this.m_isBlockDevice; + this.m_isCharacterDevice = mockResponses['isCharacterDevice'] || this.m_isCharacterDevice; + this.m_isSymbolicLink = mockResponses['isSymbolicLink'] || this.m_isSymbolicLink; + this.m_isFIFO = mockResponses['isFIFO'] || this.m_isFIFO; + this.m_isSocket = mockResponses['isSocket'] || this.m_isSocket; + this.dev = mockResponses['dev'] || this.dev; + this.ino = mockResponses['ino'] || this.ino; + this.mode = mockResponses['mode'] || this.mode; + this.nlink = mockResponses['nlink'] || this.nlink; + this.uid = mockResponses['uid'] || this.uid; + this.gid = mockResponses['gid'] || this.gid; + this.rdev = mockResponses['rdev'] || this.rdev; + this.size = mockResponses['size'] || this.size; + this.blksize = mockResponses['blksize'] || this.blksize; + this.blocks = mockResponses['blocks'] || this.blocks; + this.atime = mockResponses['atime'] || this.atime; + this.mtime = mockResponses['mtime'] || this.mtime; + this.ctime = mockResponses['ctime'] || this.ctime; + this.m_isSocket = mockResponses['isSocket'] || this.m_isSocket; + }; + FsStats.prototype.isFile = function () { + return this.m_isFile; + }; + FsStats.prototype.isDirectory = function () { + return this.m_isDirectory; + }; + FsStats.prototype.isBlockDevice = function () { + return this.m_isBlockDevice; + }; + FsStats.prototype.isCharacterDevice = function () { + return this.m_isCharacterDevice; + }; + FsStats.prototype.isSymbolicLink = function () { + return this.m_isSymbolicLink; + }; + FsStats.prototype.isFIFO = function () { + return this.m_isFIFO; + }; + FsStats.prototype.isSocket = function () { + return this.m_isSocket; + }; + return FsStats; +}()); +exports.FsStats = FsStats; +function stats(path) { + var fsStats = new FsStats(); + fsStats.setAnswers(mock.getResponse('stats', path, module.exports.debug) || {}); + return fsStats; +} +exports.stats = stats; +function exist(path) { + return mock.getResponse('exist', path, module.exports.debug) || false; +} +exports.exist = exist; +function writeFile(file, data, options) { + //do nothing +} +exports.writeFile = writeFile; +function osType() { + return mock.getResponse('osType', 'osType', module.exports.debug); +} +exports.osType = osType; +function getPlatform() { + return mock.getResponse('getPlatform', 'getPlatform', module.exports.debug); +} +exports.getPlatform = getPlatform; +function cwd() { + return mock.getResponse('cwd', 'cwd', module.exports.debug); +} +exports.cwd = cwd; +//----------------------------------------------------- +// Cmd Helpers +//----------------------------------------------------- +module.exports.command = task.command; +module.exports.warning = task.warning; +module.exports.error = task.error; +module.exports.debug = task.debug; +function cd(path) { + // do nothing. TODO: keep stack with asserts +} +exports.cd = cd; +function pushd(path) { + // do nothing. TODO: keep stack with asserts +} +exports.pushd = pushd; +function popd() { + // do nothing. TODO: keep stack with asserts +} +exports.popd = popd; +//------------------------------------------------ +// Validation Helpers +//------------------------------------------------ +function checkPath(p, name) { + module.exports.debug('check path : ' + p); + if (!p || !mock.getResponse('checkPath', p, module.exports.debug)) { + throw new Error('Not found ' + p); + } +} +exports.checkPath = checkPath; +//----------------------------------------------------- +// Shell/File I/O Helpers +// Abstract these away so we can +// - default to good error handling +// - inject system.debug info +// - have option to switch internal impl (shelljs now) +//----------------------------------------------------- +function mkdirP(p) { + module.exports.debug('creating path: ' + p); +} +exports.mkdirP = mkdirP; +function resolve() { + // we can't do ...param if we target ES6 and node 5. This is what <=ES5 compiles down to. + //return the posix implementation in the mock, so paths will be consistent when L0 tests are run on Windows or Mac/Linux + var absolutePath = path.posix.resolve.apply(this, arguments); + module.exports.debug('Absolute path for pathSegments: ' + arguments + ' = ' + absolutePath); + return absolutePath; +} +exports.resolve = resolve; +function which(tool, check) { + var response = mock.getResponse('which', tool, module.exports.debug); + if (check) { + checkPath(response, tool); + } + return response; +} +exports.which = which; +function ls(options, paths) { + var response = mock.getResponse('ls', paths[0], module.exports.debug); + if (!response) { + return []; + } + return response; +} +exports.ls = ls; +function cp(source, dest) { + module.exports.debug('###copying###'); + module.exports.debug('copying ' + source + ' to ' + dest); +} +exports.cp = cp; +function retry(func, args, retryOptions) { + module.exports.debug("trying to execute " + (func === null || func === void 0 ? void 0 : func.name) + "(" + args.toString() + ") with " + retryOptions.retryCount + " retries"); +} +exports.retry = retry; +function find(findPath) { + return mock.getResponse('find', findPath, module.exports.debug); +} +exports.find = find; +function rmRF(path) { + module.exports.debug('rmRF ' + path); + var response = mock.getResponse('rmRF', path, module.exports.debug); + if (!response['success']) { + module.exports.setResult(1, response['message']); + } +} +exports.rmRF = rmRF; +function mv(source, dest, force, continueOnError) { + module.exports.debug('moving ' + source + ' to ' + dest); + return true; +} +exports.mv = mv; +//----------------------------------------------------- +// Exec convenience wrapper +//----------------------------------------------------- +function exec(tool, args, options) { + var toolPath = which(tool, true); + var tr = this.tool(toolPath); + if (args) { + tr.arg(args); + } + return tr.exec(options); +} +exports.exec = exec; +function execSync(tool, args, options) { + var toolPath = which(tool, true); + var tr = this.tool(toolPath); + if (args) { + tr.arg(args); + } + return tr.execSync(options); +} +exports.execSync = execSync; +function tool(tool) { + var tr = new trm.ToolRunner(tool); + tr.on('debug', function (message) { + module.exports.debug(message); + }); + return tr; +} +exports.tool = tool; +//----------------------------------------------------- +// Matching helpers +//----------------------------------------------------- +module.exports.filter = task.filter; +module.exports.match = task.match; +function findMatch(defaultRoot, patterns) { + var responseKey = typeof patterns == 'object' ? patterns.join('\n') : patterns; + return mock.getResponse('findMatch', responseKey, module.exports.debug); +} +exports.findMatch = findMatch; +function legacyFindFiles(rootDirectory, pattern, includeFiles, includeDirectories) { + return mock.getResponse('legacyFindFiles', pattern, module.exports.debug); +} +exports.legacyFindFiles = legacyFindFiles; +//----------------------------------------------------- +// Test Publisher +//----------------------------------------------------- +var TestPublisher = /** @class */ (function () { + function TestPublisher(testRunner) { + this.testRunner = testRunner; + } + TestPublisher.prototype.publish = function (resultFiles, mergeResults, platform, config, runTitle, publishRunAttachments) { + var properties = {}; + properties['type'] = this.testRunner; + if (mergeResults) { + properties['mergeResults'] = mergeResults; + } + if (platform) { + properties['platform'] = platform; + } + if (config) { + properties['config'] = config; + } + if (runTitle) { + properties['runTitle'] = runTitle; + } + if (publishRunAttachments) { + properties['publishRunAttachments'] = publishRunAttachments; + } + if (resultFiles) { + properties['resultFiles'] = resultFiles; + } + module.exports.command('results.publish', properties, ''); + }; + return TestPublisher; +}()); +exports.TestPublisher = TestPublisher; +//----------------------------------------------------- +// Code Coverage Publisher +//----------------------------------------------------- +var CodeCoveragePublisher = /** @class */ (function () { + function CodeCoveragePublisher() { + } + CodeCoveragePublisher.prototype.publish = function (codeCoverageTool, summaryFileLocation, reportDirectory, additionalCodeCoverageFiles) { + var properties = {}; + if (codeCoverageTool) { + properties['codecoveragetool'] = codeCoverageTool; + } + if (summaryFileLocation) { + properties['summaryfile'] = summaryFileLocation; + } + if (reportDirectory) { + properties['reportdirectory'] = reportDirectory; + } + if (additionalCodeCoverageFiles) { + properties['additionalcodecoveragefiles'] = additionalCodeCoverageFiles; + } + module.exports.command('codecoverage.publish', properties, ""); + }; + return CodeCoveragePublisher; +}()); +exports.CodeCoveragePublisher = CodeCoveragePublisher; +//----------------------------------------------------- +// Code coverage Publisher +//----------------------------------------------------- +var CodeCoverageEnabler = /** @class */ (function () { + function CodeCoverageEnabler(buildTool, ccTool) { + this.buildTool = buildTool; + this.ccTool = ccTool; + } + CodeCoverageEnabler.prototype.enableCodeCoverage = function (buildProps) { + buildProps['buildtool'] = this.buildTool; + buildProps['codecoveragetool'] = this.ccTool; + module.exports.command('codecoverage.enable', buildProps, ""); + }; + return CodeCoverageEnabler; +}()); +exports.CodeCoverageEnabler = CodeCoverageEnabler; +//----------------------------------------------------- +// Task Logging Commands +//----------------------------------------------------- +exports.uploadFile = task.uploadFile; +exports.prependPath = task.prependPath; +exports.uploadSummary = task.uploadSummary; +exports.addAttachment = task.addAttachment; +exports.setEndpoint = task.setEndpoint; +exports.setProgress = task.setProgress; +exports.logDetail = task.logDetail; +exports.logIssue = task.logIssue; +//----------------------------------------------------- +// Artifact Logging Commands +//----------------------------------------------------- +exports.uploadArtifact = task.uploadArtifact; +exports.associateArtifact = task.associateArtifact; +//----------------------------------------------------- +// Build Logging Commands +//----------------------------------------------------- +exports.uploadBuildLog = task.uploadBuildLog; +exports.updateBuildNumber = task.updateBuildNumber; +exports.addBuildTag = task.addBuildTag; +//----------------------------------------------------- +// Release Logging Commands +//----------------------------------------------------- +exports.updateReleaseName = task.updateReleaseName; +//----------------------------------------------------- +// Tools +//----------------------------------------------------- +exports.TaskCommand = tcm.TaskCommand; +exports.commandFromString = tcm.commandFromString; +exports.ToolRunner = trm.ToolRunner; +//----------------------------------------------------- +// Http Proxy Helper +//----------------------------------------------------- +function getHttpProxyConfiguration(requestUrl) { + return null; +} +exports.getHttpProxyConfiguration = getHttpProxyConfiguration; +//----------------------------------------------------- +// Http Certificate Helper +//----------------------------------------------------- +function getHttpCertConfiguration() { + return null; +} +exports.getHttpCertConfiguration = getHttpCertConfiguration; diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-test.d.ts b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-test.d.ts new file mode 100644 index 0000000..2207dc7 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-test.d.ts @@ -0,0 +1,28 @@ +export declare class MockTestRunner { + constructor(testPath: string, taskJsonPath?: string); + private _testPath; + private _taskJsonPath; + nodePath: string; + stdout: string; + stderr: string; + cmdlines: {}; + invokedToolCount: number; + succeeded: boolean; + errorIssues: string[]; + warningIssues: string[]; + get failed(): boolean; + ran(cmdline: string): boolean; + createdErrorIssue(message: string): boolean; + createdWarningIssue(message: string): boolean; + stdOutContained(message: string): boolean; + stdErrContained(message: string): boolean; + run(nodeVersion?: number): void; + private getNodePath; + private getNodeVersion; + private getTaskJsonPath; + private downloadNode; + private downloadFile; + private downloadTarGz; + private getPathToNodeExe; + private getPlatform; +} diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-test.js b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-test.js new file mode 100644 index 0000000..a92e68b --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-test.js @@ -0,0 +1,295 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MockTestRunner = void 0; +var cp = require("child_process"); +var fs = require("fs"); +var ncp = require("child_process"); +var os = require("os"); +var path = require("path"); +var cmdm = require("./taskcommand"); +var shelljs = require("shelljs"); +var sync_request_1 = require("sync-request"); +var COMMAND_TAG = '[command]'; +var COMMAND_LENGTH = COMMAND_TAG.length; +var downloadDirectory = path.join(process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE, 'azure-pipelines-task-lib', '_download'); +var MockTestRunner = /** @class */ (function () { + function MockTestRunner(testPath, taskJsonPath) { + this._testPath = ''; + this._taskJsonPath = ''; + this.nodePath = ''; + this.stdout = ''; + this.stderr = ''; + this.cmdlines = {}; + this.invokedToolCount = 0; + this.succeeded = false; + this.errorIssues = []; + this.warningIssues = []; + this._taskJsonPath = taskJsonPath || ''; + this._testPath = testPath; + this.nodePath = this.getNodePath(); + } + Object.defineProperty(MockTestRunner.prototype, "failed", { + get: function () { + return !this.succeeded; + }, + enumerable: false, + configurable: true + }); + MockTestRunner.prototype.ran = function (cmdline) { + return this.cmdlines.hasOwnProperty(cmdline.trim()); + }; + MockTestRunner.prototype.createdErrorIssue = function (message) { + return this.errorIssues.indexOf(message.trim()) >= 0; + }; + MockTestRunner.prototype.createdWarningIssue = function (message) { + return this.warningIssues.indexOf(message.trim()) >= 0; + }; + MockTestRunner.prototype.stdOutContained = function (message) { + return this.stdout.indexOf(message) > 0; + }; + MockTestRunner.prototype.stdErrContained = function (message) { + return this.stderr.indexOf(message) > 0; + }; + MockTestRunner.prototype.run = function (nodeVersion) { + var _this = this; + this.cmdlines = {}; + this.invokedToolCount = 0; + this.succeeded = true; + this.errorIssues = []; + this.warningIssues = []; + var nodePath = this.nodePath; + if (nodeVersion) { + nodePath = this.getNodePath(nodeVersion); + } + var spawn = cp.spawnSync(nodePath, [this._testPath]); + // Clean environment + Object.keys(process.env) + .filter(function (key) { return (key.substr(0, 'INPUT_'.length) === 'INPUT_' || + key.substr(0, 'SECRET_'.length) === 'SECRET_' || + key.substr(0, 'VSTS_TASKVARIABLE_'.length) === 'VSTS_TASKVARIABLE_'); }) + .forEach(function (key) { return delete process.env[key]; }); + if (spawn.error) { + console.error('Running test failed'); + console.error(spawn.error.message); + return; + } + this.stdout = spawn.stdout.toString(); + this.stderr = spawn.stderr.toString(); + if (process.env['TASK_TEST_TRACE']) { + console.log(''); + } + var lines = this.stdout.replace(/\r\n/g, '\n').split('\n'); + var traceFile = this._testPath + '.log'; + lines.forEach(function (line) { + var ci = line.indexOf('##vso['); + var cmd; + var cmi = line.indexOf(COMMAND_TAG); + if (ci >= 0) { + cmd = cmdm.commandFromString(line.substring(ci)); + if (cmd.command === 'task.complete' && cmd.properties['result'] === 'Failed') { + _this.succeeded = false; + } + if (cmd.command === 'task.issue' && cmd.properties['type'] === 'error') { + _this.errorIssues.push(cmd.message.trim()); + } + if (cmd.command === 'task.issue' && cmd.properties['type'] === 'warning') { + _this.warningIssues.push(cmd.message.trim()); + } + } + else if (cmi == 0 && line.length > COMMAND_LENGTH) { + var cmdline = line.substr(COMMAND_LENGTH).trim(); + _this.cmdlines[cmdline] = true; + _this.invokedToolCount++; + } + if (process.env['TASK_TEST_TRACE']) { + fs.appendFileSync(traceFile, line + os.EOL); + if (line && !cmd) { + console.log(line); + } + // don't print task.debug commands to console - too noisy. + // otherwise omit command details - can interfere during CI. + else if (cmd && cmd.command != 'task.debug') { + console.log(cmd.command + " details omitted"); + } + } + }); + if (this.stderr && process.env['TASK_TEST_TRACE']) { + console.log('STDERR: ' + this.stderr); + fs.appendFileSync(traceFile, 'STDERR: ' + this.stderr + os.EOL); + } + if (process.env['TASK_TEST_TRACE']) { + console.log('TRACE FILE: ' + traceFile); + } + }; + // Returns a path to node.exe with the correct version for this task (based on if its node10 or node) + MockTestRunner.prototype.getNodePath = function (nodeVersion) { + var version = nodeVersion || this.getNodeVersion(); + var downloadVersion; + switch (version) { + case 6: + downloadVersion = 'v6.17.1'; + break; + case 10: + downloadVersion = 'v10.21.0'; + break; + case 16: + downloadVersion = 'v16.13.0'; + break; + default: + throw new Error('Invalid node version, must be 6, 10, or 16 (received ' + version + ')'); + } + // Install node in home directory if it isn't already there. + var downloadDestination = path.join(downloadDirectory, 'node' + version); + var pathToExe = this.getPathToNodeExe(downloadVersion, downloadDestination); + if (pathToExe) { + return pathToExe; + } + else { + return this.downloadNode(downloadVersion, downloadDestination); + } + }; + // Determines the correct version of node to use based on the contents of the task's task.json. Defaults to Node 16. + MockTestRunner.prototype.getNodeVersion = function () { + var taskJsonPath = this.getTaskJsonPath(); + if (!taskJsonPath) { + console.warn('Unable to find task.json, defaulting to use Node 16'); + return 16; + } + var taskJsonContents = fs.readFileSync(taskJsonPath, { encoding: 'utf-8' }); + var taskJson = JSON.parse(taskJsonContents); + var nodeVersionFound = false; + var execution = (taskJson['execution'] + || taskJson['prejobexecution'] + || taskJson['postjobexecution']); + var keys = Object.keys(execution); + for (var i = 0; i < keys.length; i++) { + if (keys[i].toLowerCase() == 'node16') { + // Prefer node 16 and return immediately. + return 16; + } + else if (keys[i].toLowerCase() == 'node10') { + // Prefer node 10 and return immediately. + return 10; + } + else if (keys[i].toLowerCase() == 'node') { + nodeVersionFound = true; + } + } + if (!nodeVersionFound) { + console.warn('Unable to determine execution type from task.json, defaulting to use Node 16'); + return 16; + } + return 6; + }; + // Returns the path to the task.json for the task being tested. Returns null if unable to find it. + // Searches by moving up the directory structure from the initial starting point and checking at each level. + MockTestRunner.prototype.getTaskJsonPath = function () { + if (this._taskJsonPath) { + return this._taskJsonPath; + } + var curPath = this._testPath; + var newPath = path.join(this._testPath, '..'); + while (curPath != newPath) { + curPath = newPath; + var taskJsonPath = path.join(curPath, 'task.json'); + if (fs.existsSync(taskJsonPath)) { + return taskJsonPath; + } + newPath = path.join(curPath, '..'); + } + return ''; + }; + // Downloads the specified node version to the download destination. Returns a path to node.exe + MockTestRunner.prototype.downloadNode = function (nodeVersion, downloadDestination) { + shelljs.rm('-rf', downloadDestination); + var nodeUrl = process.env['TASK_NODE_URL'] || 'https://nodejs.org/dist'; + nodeUrl = nodeUrl.replace(/\/$/, ''); // ensure there is no trailing slash on the base URL + var downloadPath = ''; + switch (this.getPlatform()) { + case 'darwin': + this.downloadTarGz(nodeUrl + '/' + nodeVersion + '/node-' + nodeVersion + '-darwin-x64.tar.gz', downloadDestination); + downloadPath = path.join(downloadDestination, 'node-' + nodeVersion + '-darwin-x64', 'bin', 'node'); + break; + case 'linux': + this.downloadTarGz(nodeUrl + '/' + nodeVersion + '/node-' + nodeVersion + '-linux-x64.tar.gz', downloadDestination); + downloadPath = path.join(downloadDestination, 'node-' + nodeVersion + '-linux-x64', 'bin', 'node'); + break; + case 'win32': + this.downloadFile(nodeUrl + '/' + nodeVersion + '/win-x64/node.exe', downloadDestination, 'node.exe'); + this.downloadFile(nodeUrl + '/' + nodeVersion + '/win-x64/node.lib', downloadDestination, 'node.lib'); + downloadPath = path.join(downloadDestination, 'node.exe'); + } + // Write marker to indicate download completed. + var marker = downloadDestination + '.completed'; + fs.writeFileSync(marker, ''); + return downloadPath; + }; + // Downloads file to the downloadDestination, making any necessary folders along the way. + MockTestRunner.prototype.downloadFile = function (url, downloadDestination, fileName) { + var filePath = path.join(downloadDestination, fileName); + if (!url) { + throw new Error('Parameter "url" must be set.'); + } + if (!downloadDestination) { + throw new Error('Parameter "downloadDestination" must be set.'); + } + console.log('Downloading file:', url); + shelljs.mkdir('-p', downloadDestination); + var result = sync_request_1.default('GET', url); + fs.writeFileSync(filePath, result.getBody()); + }; + // Downloads tarGz to the download destination, making any necessary folders along the way. + MockTestRunner.prototype.downloadTarGz = function (url, downloadDestination) { + if (!url) { + throw new Error('Parameter "url" must be set.'); + } + if (!downloadDestination) { + throw new Error('Parameter "downloadDestination" must be set.'); + } + var tarGzName = 'node.tar.gz'; + this.downloadFile(url, downloadDestination, tarGzName); + // Extract file + var originalCwd = process.cwd(); + process.chdir(downloadDestination); + try { + ncp.execSync("tar -xzf \"" + path.join(downloadDestination, tarGzName) + "\""); + } + catch (_a) { + throw new Error('Failed to unzip node tar.gz from ' + url); + } + finally { + process.chdir(originalCwd); + } + }; + // Checks if node is installed at downloadDestination. If it is, returns a path to node.exe, otherwise returns null. + MockTestRunner.prototype.getPathToNodeExe = function (nodeVersion, downloadDestination) { + var exePath = ''; + switch (this.getPlatform()) { + case 'darwin': + exePath = path.join(downloadDestination, 'node-' + nodeVersion + '-darwin-x64', 'bin', 'node'); + break; + case 'linux': + exePath = path.join(downloadDestination, 'node-' + nodeVersion + '-linux-x64', 'bin', 'node'); + break; + case 'win32': + exePath = path.join(downloadDestination, 'node.exe'); + } + // Only use path if marker is found indicating download completed successfully (and not partially) + var marker = downloadDestination + '.completed'; + if (fs.existsSync(exePath) && fs.existsSync(marker)) { + return exePath; + } + else { + return ''; + } + }; + MockTestRunner.prototype.getPlatform = function () { + var platform = os.platform(); + if (platform != 'darwin' && platform != 'linux' && platform != 'win32') { + throw new Error('Unexpected platform: ' + platform); + } + return platform; + }; + return MockTestRunner; +}()); +exports.MockTestRunner = MockTestRunner; diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-toolrunner.d.ts b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-toolrunner.d.ts new file mode 100644 index 0000000..01cf689 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-toolrunner.d.ts @@ -0,0 +1,41 @@ +/// +import Q = require('q'); +import events = require('events'); +import ma = require('./mock-answer'); +export declare function setAnswers(answers: ma.TaskLibAnswers): void; +export interface IExecOptions extends IExecSyncOptions { + failOnStdErr?: boolean; + ignoreReturnCode?: boolean; +} +export interface IExecSyncOptions { + cwd?: string; + env?: { + [key: string]: string | undefined; + }; + silent?: boolean; + outStream: NodeJS.WritableStream; + errStream: NodeJS.WritableStream; + windowsVerbatimArguments?: boolean; +} +export interface IExecSyncResult { + stdout: string; + stderr: string; + code: number; + error: Error; +} +export declare function debug(message: any): void; +export declare class ToolRunner extends events.EventEmitter { + constructor(toolPath: string); + private toolPath; + private args; + private pipeOutputToTool; + private _debug; + private _argStringToArray; + arg(val: any): ToolRunner; + argIf(condition: any, val: any): ToolRunner; + line(val: string): ToolRunner; + pipeExecOutputToTool(tool: ToolRunner): ToolRunner; + private ignoreTempPath; + exec(options?: IExecOptions): Q.Promise; + execSync(options?: IExecSyncOptions): IExecSyncResult; +} diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-toolrunner.js b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-toolrunner.js new file mode 100644 index 0000000..1254d2a --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/mock-toolrunner.js @@ -0,0 +1,268 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ToolRunner = exports.debug = exports.setAnswers = void 0; +var Q = require("q"); +var os = require("os"); +var events = require("events"); +var ma = require("./mock-answer"); +var mock = new ma.MockAnswers(); +function setAnswers(answers) { + mock.initialize(answers); +} +exports.setAnswers = setAnswers; +; +; +function debug(message) { + // do nothing, overridden +} +exports.debug = debug; +var ToolRunner = /** @class */ (function (_super) { + __extends(ToolRunner, _super); + function ToolRunner(toolPath) { + var _this = this; + debug('toolRunner toolPath: ' + toolPath); + _this = _super.call(this) || this; + _this.toolPath = toolPath; + _this.args = []; + return _this; + } + ToolRunner.prototype._debug = function (message) { + debug(message); + this.emit('debug', message); + }; + ToolRunner.prototype._argStringToArray = function (argString) { + var args = []; + var inQuotes = false; + var escaped = false; + var arg = ''; + var append = function (c) { + // we only escape double quotes. + if (escaped && c !== '"') { + arg += '\\'; + } + arg += c; + escaped = false; + }; + for (var i = 0; i < argString.length; i++) { + var c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } + else { + append(c); + } + continue; + } + if (c === "\\" && inQuotes) { + escaped = true; + continue; + } + if (c === ' ' && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ''; + } + continue; + } + append(c); + } + if (arg.length > 0) { + args.push(arg.trim()); + } + return args; + }; + ToolRunner.prototype.arg = function (val) { + if (!val) { + return this; + } + if (val instanceof Array) { + this._debug(this.toolPath + ' arg: ' + JSON.stringify(val)); + this.args = this.args.concat(val); + } + else if (typeof (val) === 'string') { + this._debug(this.toolPath + ' arg: ' + val); + this.args = this.args.concat(val.trim()); + } + return this; + }; + ToolRunner.prototype.argIf = function (condition, val) { + if (condition) { + this.arg(val); + } + return this; + }; + ToolRunner.prototype.line = function (val) { + if (!val) { + return this; + } + this._debug(this.toolPath + ' arg: ' + val); + this.args = this.args.concat(this._argStringToArray(val)); + return this; + }; + ToolRunner.prototype.pipeExecOutputToTool = function (tool) { + this.pipeOutputToTool = tool; + return this; + }; + ToolRunner.prototype.ignoreTempPath = function (cmdString) { + this._debug('ignoreTempPath=' + process.env['MOCK_IGNORE_TEMP_PATH']); + this._debug('tempPath=' + process.env['MOCK_TEMP_PATH']); + if (process.env['MOCK_IGNORE_TEMP_PATH'] === 'true') { + // Using split/join to replace the temp path + cmdString = cmdString.split(process.env['MOCK_TEMP_PATH'] || "").join(''); + } + return cmdString; + }; + // + // Exec - use for long running tools where you need to stream live output as it runs + // returns a promise with return code. + // + ToolRunner.prototype.exec = function (options) { + var _this = this; + var defer = Q.defer(); + this._debug('exec tool: ' + this.toolPath); + this._debug('Arguments:'); + this.args.forEach(function (arg) { + _this._debug(' ' + arg); + }); + var success = true; + options = options || {}; + var ops = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + outStream: options.outStream || process.stdout, + errStream: options.errStream || process.stderr, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + windowsVerbatimArguments: options.windowsVerbatimArguments + }; + var argString = this.args.join(' ') || ''; + var cmdString = this.toolPath; + if (argString) { + cmdString += (' ' + argString); + } + // Using split/join to replace the temp path + cmdString = this.ignoreTempPath(cmdString); + if (!ops.silent) { + if (this.pipeOutputToTool) { + var pipeToolArgString = this.pipeOutputToTool.args.join(' ') || ''; + var pipeToolCmdString = this.ignoreTempPath(this.pipeOutputToTool.toolPath); + if (pipeToolArgString) { + pipeToolCmdString += (' ' + pipeToolArgString); + } + cmdString += ' | ' + pipeToolCmdString; + } + ops.outStream.write('[command]' + cmdString + os.EOL); + } + // TODO: filter process.env + var res = mock.getResponse('exec', cmdString, debug); + if (res.stdout) { + this.emit('stdout', res.stdout); + if (!ops.silent) { + ops.outStream.write(res.stdout + os.EOL); + } + var stdLineArray = res.stdout.split(os.EOL); + for (var _i = 0, _a = stdLineArray.slice(0, -1); _i < _a.length; _i++) { + var line = _a[_i]; + this.emit('stdline', line); + } + if (stdLineArray.length > 0 && stdLineArray[stdLineArray.length - 1].length > 0) { + this.emit('stdline', stdLineArray[stdLineArray.length - 1]); + } + } + if (res.stderr) { + this.emit('stderr', res.stderr); + success = !ops.failOnStdErr; + if (!ops.silent) { + var s = ops.failOnStdErr ? ops.errStream : ops.outStream; + s.write(res.stderr + os.EOL); + } + var stdErrArray = res.stderr.split(os.EOL); + for (var _b = 0, _c = stdErrArray.slice(0, -1); _b < _c.length; _b++) { + var line = _c[_b]; + this.emit('errline', line); + } + if (stdErrArray.length > 0 && stdErrArray[stdErrArray.length - 1].length > 0) { + this.emit('errline', stdErrArray[stdErrArray.length - 1]); + } + } + var code = res.code; + if (!ops.silent) { + ops.outStream.write('rc:' + res.code + os.EOL); + } + if (code != 0 && !ops.ignoreReturnCode) { + success = false; + } + if (!ops.silent) { + ops.outStream.write('success:' + success + os.EOL); + } + if (success) { + defer.resolve(code); + } + else { + defer.reject(new Error(this.toolPath + ' failed with return code: ' + code)); + } + return defer.promise; + }; + // + // ExecSync - use for short running simple commands. Simple and convenient (synchronous) + // but also has limits. For example, no live output and limited to max buffer + // + ToolRunner.prototype.execSync = function (options) { + var _this = this; + var defer = Q.defer(); + this._debug('exec tool: ' + this.toolPath); + this._debug('Arguments:'); + this.args.forEach(function (arg) { + _this._debug(' ' + arg); + }); + var success = true; + options = options || {}; + var ops = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + outStream: options.outStream || process.stdout, + errStream: options.errStream || process.stderr, + windowsVerbatimArguments: options.windowsVerbatimArguments, + }; + var argString = this.args.join(' ') || ''; + var cmdString = this.toolPath; + // Using split/join to replace the temp path + cmdString = this.ignoreTempPath(cmdString); + if (argString) { + cmdString += (' ' + argString); + } + if (!ops.silent) { + ops.outStream.write('[command]' + cmdString + os.EOL); + } + var r = mock.getResponse('exec', cmdString, debug); + if (!ops.silent && r.stdout && r.stdout.length > 0) { + ops.outStream.write(r.stdout); + } + if (!ops.silent && r.stderr && r.stderr.length > 0) { + ops.errStream.write(r.stderr); + } + return { + code: r.code, + stdout: (r.stdout) ? r.stdout.toString() : null, + stderr: (r.stderr) ? r.stderr.toString() : null + }; + }; + return ToolRunner; +}(events.EventEmitter)); +exports.ToolRunner = ToolRunner; diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/package.json b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/package.json new file mode 100644 index 0000000..1aa1e1a --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/package.json @@ -0,0 +1,77 @@ +{ + "_from": "azure-pipelines-task-lib@latest", + "_id": "azure-pipelines-task-lib@4.1.0", + "_inBundle": false, + "_integrity": "sha512-8CNC9PcP+4eS76QcIDmPmBfrrao9xpy/M0Uts4TWk3chfr3uOXFGf0DYHVTJGF9180g51kyVXYTObicouq0KZQ==", + "_location": "/azure-pipelines-task-lib", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "azure-pipelines-task-lib@latest", + "name": "azure-pipelines-task-lib", + "escapedName": "azure-pipelines-task-lib", + "rawSpec": "latest", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.1.0.tgz", + "_shasum": "f84228a4fc60a90145b045666bb629ba79cd5a21", + "_spec": "azure-pipelines-task-lib@latest", + "_where": "C:\\ado\\Extension-UtilitiesPack\\Utilites\\Shell++", + "author": { + "name": "Microsoft" + }, + "bugs": { + "url": "https://github.com/Microsoft/azure-pipelines-task-lib/issues" + }, + "bundleDependencies": false, + "dependencies": { + "minimatch": "3.0.5", + "mockery": "^2.1.0", + "q": "^1.5.1", + "semver": "^5.1.0", + "shelljs": "^0.8.5", + "sync-request": "6.1.0", + "uuid": "^3.0.1" + }, + "deprecated": false, + "description": "Azure Pipelines Task SDK", + "devDependencies": { + "@types/minimatch": "3.0.3", + "@types/mocha": "^9.1.1", + "@types/mockery": "^1.4.29", + "@types/node": "^16.11.39", + "@types/q": "^1.5.4", + "@types/semver": "^7.3.4", + "@types/shelljs": "^0.8.8", + "mocha": "^9.2.2", + "typescript": "^4.0.0" + }, + "homepage": "https://github.com/Microsoft/azure-pipelines-task-lib", + "keywords": [ + "azure-pipelines", + "agent", + "build", + "release", + "ci-cd", + "task" + ], + "license": "MIT", + "main": "./task.js", + "name": "azure-pipelines-task-lib", + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/azure-pipelines-task-lib.git" + }, + "scripts": { + "build": "node make.js build", + "test": "node make.js test" + }, + "typings": "./task.d.ts", + "version": "4.1.0" +} diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/task.d.ts b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/task.d.ts new file mode 100644 index 0000000..6b2ddb9 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/task.d.ts @@ -0,0 +1,718 @@ +/// +import Q = require('q'); +import fs = require('fs'); +import im = require('./internal'); +import trm = require('./toolrunner'); +export declare enum TaskResult { + Succeeded = 0, + SucceededWithIssues = 1, + Failed = 2, + Cancelled = 3, + Skipped = 4 +} +export declare enum TaskState { + Unknown = 0, + Initialized = 1, + InProgress = 2, + Completed = 3 +} +export declare enum IssueType { + Error = 0, + Warning = 1 +} +export declare enum ArtifactType { + Container = 0, + FilePath = 1, + VersionControl = 2, + GitRef = 3, + TfvcLabel = 4 +} +export declare enum FieldType { + AuthParameter = 0, + DataParameter = 1, + Url = 2 +} +/** Platforms supported by our build agent */ +export declare enum Platform { + Windows = 0, + MacOS = 1, + Linux = 2 +} +export declare const setStdStream: typeof im._setStdStream; +export declare const setErrStream: typeof im._setErrStream; +/** + * Sets the result of the task. + * Execution will continue. + * If not set, task will be Succeeded. + * If multiple calls are made to setResult the most pessimistic call wins (Failed) regardless of the order of calls. + * + * @param result TaskResult enum of Succeeded, SucceededWithIssues, Failed, Cancelled or Skipped. + * @param message A message which will be logged as an error issue if the result is Failed. + * @param done Optional. Instructs the agent the task is done. This is helpful when child processes + * may still be running and prevent node from fully exiting. This argument is supported + * from agent version 2.142.0 or higher (otherwise will no-op). + * @returns void + */ +export declare function setResult(result: TaskResult, message: string, done?: boolean): void; +export declare const setResourcePath: typeof im._setResourcePath; +export declare const loc: typeof im._loc; +export declare const getVariable: typeof im._getVariable; +/** + * Asserts the agent version is at least the specified minimum. + * + * @param minimum minimum version version - must be 2.104.1 or higher + */ +export declare function assertAgent(minimum: string): void; +/** + * Gets a snapshot of the current state of all job variables available to the task. + * Requires a 2.104.1 agent or higher for full functionality. + * + * Limitations on an agent prior to 2.104.1: + * 1) The return value does not include all public variables. Only public variables + * that have been added using setVariable are returned. + * 2) The name returned for each secret variable is the formatted environment variable + * name, not the actual variable name (unless it was set explicitly at runtime using + * setVariable). + * + * @returns VariableInfo[] + */ +export declare function getVariables(): VariableInfo[]; +/** + * Sets a variable which will be available to subsequent tasks as well. + * + * @param name name of the variable to set + * @param val value to set + * @param secret whether variable is secret. Multi-line secrets are not allowed. Optional, defaults to false + * @param isOutput whether variable is an output variable. Optional, defaults to false + * @returns void + */ +export declare function setVariable(name: string, val: string, secret?: boolean, isOutput?: boolean): void; +/** + * Registers a value with the logger, so the value will be masked from the logs. Multi-line secrets are not allowed. + * + * @param val value to register + */ +export declare function setSecret(val: string): void; +/** Snapshot of a variable at the time when getVariables was called. */ +export interface VariableInfo { + name: string; + value: string; + secret: boolean; +} +/** + * Gets the value of an input. + * If required is true and the value is not set, it will throw. + * + * @param name name of the input to get + * @param required whether input is required. optional, defaults to false + * @returns string + */ +export declare function getInput(name: string, required?: boolean): string | undefined; +/** + * Gets the value of an input. + * If the value is not set, it will throw. + * + * @param name name of the input to get + * @returns string + */ +export declare function getInputRequired(name: string): string; +/** + * Gets the value of an input and converts to a bool. Convenience. + * If required is true and the value is not set, it will throw. + * If required is false and the value is not set, returns false. + * + * @param name name of the bool input to get + * @param required whether input is required. optional, defaults to false + * @returns boolean + */ +export declare function getBoolInput(name: string, required?: boolean): boolean; +/** + * Gets the value of an input and splits the value using a delimiter (space, comma, etc). + * Empty values are removed. This function is useful for splitting an input containing a simple + * list of items - such as build targets. + * IMPORTANT: Do not use this function for splitting additional args! Instead use argString(), which + * follows normal argument splitting rules and handles values encapsulated by quotes. + * If required is true and the value is not set, it will throw. + * + * @param name name of the input to get + * @param delim delimiter to split on + * @param required whether input is required. optional, defaults to false + * @returns string[] + */ +export declare function getDelimitedInput(name: string, delim: string | RegExp, required?: boolean): string[]; +/** + * Checks whether a path inputs value was supplied by the user + * File paths are relative with a picker, so an empty path is the root of the repo. + * Useful if you need to condition work (like append an arg) if a value was supplied + * + * @param name name of the path input to check + * @returns boolean + */ +export declare function filePathSupplied(name: string): boolean; +/** + * Gets the value of a path input + * It will be quoted for you if it isn't already and contains spaces + * If required is true and the value is not set, it will throw. + * If check is true and the path does not exist, it will throw. + * + * @param name name of the input to get + * @param required whether input is required. optional, defaults to false + * @param check whether path is checked. optional, defaults to false + * @returns string + */ +export declare function getPathInput(name: string, required?: boolean, check?: boolean): string | undefined; +/** + * Gets the value of a path input + * It will be quoted for you if it isn't already and contains spaces + * If the value is not set, it will throw. + * If check is true and the path does not exist, it will throw. + * + * @param name name of the input to get + * @param check whether path is checked. optional, defaults to false + * @returns string + */ +export declare function getPathInputRequired(name: string, check?: boolean): string; +/** + * Gets the url for a service endpoint + * If the url was not set and is not optional, it will throw. + * + * @param id name of the service endpoint + * @param optional whether the url is optional + * @returns string + */ +export declare function getEndpointUrl(id: string, optional: boolean): string | undefined; +/** + * Gets the url for a service endpoint + * If the url was not set, it will throw. + * + * @param id name of the service endpoint + * @returns string + */ +export declare function getEndpointUrlRequired(id: string): string; +export declare function getEndpointDataParameter(id: string, key: string, optional: boolean): string | undefined; +export declare function getEndpointDataParameterRequired(id: string, key: string): string; +/** + * Gets the endpoint authorization scheme for a service endpoint + * If the endpoint authorization scheme is not set and is not optional, it will throw. + * + * @param id name of the service endpoint + * @param optional whether the endpoint authorization scheme is optional + * @returns {string} value of the endpoint authorization scheme + */ +export declare function getEndpointAuthorizationScheme(id: string, optional: boolean): string | undefined; +/** + * Gets the endpoint authorization scheme for a service endpoint + * If the endpoint authorization scheme is not set, it will throw. + * + * @param id name of the service endpoint + * @returns {string} value of the endpoint authorization scheme + */ +export declare function getEndpointAuthorizationSchemeRequired(id: string): string; +/** + * Gets the endpoint authorization parameter value for a service endpoint with specified key + * If the endpoint authorization parameter is not set and is not optional, it will throw. + * + * @param id name of the service endpoint + * @param key key to find the endpoint authorization parameter + * @param optional optional whether the endpoint authorization scheme is optional + * @returns {string} value of the endpoint authorization parameter value + */ +export declare function getEndpointAuthorizationParameter(id: string, key: string, optional: boolean): string | undefined; +/** + * Gets the endpoint authorization parameter value for a service endpoint with specified key + * If the endpoint authorization parameter is not set, it will throw. + * + * @param id name of the service endpoint + * @param key key to find the endpoint authorization parameter + * @returns {string} value of the endpoint authorization parameter value + */ +export declare function getEndpointAuthorizationParameterRequired(id: string, key: string): string; +/** + * Interface for EndpointAuthorization + * Contains a schema and a string/string dictionary of auth data + */ +export interface EndpointAuthorization { + /** dictionary of auth data */ + parameters: { + [key: string]: string; + }; + /** auth scheme such as OAuth or username/password etc... */ + scheme: string; +} +/** + * Gets the authorization details for a service endpoint + * If the authorization was not set and is not optional, it will set the task result to Failed. + * + * @param id name of the service endpoint + * @param optional whether the url is optional + * @returns string + */ +export declare function getEndpointAuthorization(id: string, optional: boolean): EndpointAuthorization | undefined; +/** + * Gets the name for a secure file + * + * @param id secure file id + * @returns string + */ +export declare function getSecureFileName(id: string): string | undefined; +/** + * Gets the secure file ticket that can be used to download the secure file contents + * + * @param id name of the secure file + * @returns {string} secure file ticket + */ +export declare function getSecureFileTicket(id: string): string | undefined; +/** + * Gets a variable value that is set by previous step from the same wrapper task. + * Requires a 2.115.0 agent or higher. + * + * @param name name of the variable to get + * @returns string + */ +export declare function getTaskVariable(name: string): string | undefined; +/** + * Sets a task variable which will only be available to subsequent steps belong to the same wrapper task. + * Requires a 2.115.0 agent or higher. + * + * @param name name of the variable to set + * @param val value to set + * @param secret whether variable is secret. optional, defaults to false + * @returns void + */ +export declare function setTaskVariable(name: string, val: string, secret?: boolean): void; +export declare const command: typeof im._command; +export declare const warning: typeof im._warning; +export declare const error: typeof im._error; +export declare const debug: typeof im._debug; +export interface FsStats extends fs.Stats { +} +/** + * Get's stat on a path. + * Useful for checking whether a file or directory. Also getting created, modified and accessed time. + * see [fs.stat](https://nodejs.org/api/fs.html#fs_class_fs_stats) + * + * @param path path to check + * @returns fsStat + */ +export declare function stats(path: string): FsStats; +export declare const exist: typeof im._exist; +export declare function writeFile(file: string, data: string | Buffer, options?: BufferEncoding | fs.WriteFileOptions): void; +/** + * @deprecated Use `getPlatform` + * Useful for determining the host operating system. + * see [os.type](https://nodejs.org/api/os.html#os_os_type) + * + * @return the name of the operating system + */ +export declare function osType(): string; +/** + * Determine the operating system the build agent is running on. + * @returns {Platform} + * @throws {Error} Platform is not supported by our agent + */ +export declare function getPlatform(): Platform; +/** + * Returns the process's current working directory. + * see [process.cwd](https://nodejs.org/api/process.html#process_process_cwd) + * + * @return the path to the current working directory of the process + */ +export declare function cwd(): string; +export declare const checkPath: typeof im._checkPath; +/** + * Change working directory. + * + * @param path new working directory path + * @returns void + */ +export declare function cd(path: string): void; +/** + * Change working directory and push it on the stack + * + * @param path new working directory path + * @returns void + */ +export declare function pushd(path: string): void; +/** + * Change working directory back to previously pushed directory + * + * @returns void + */ +export declare function popd(): void; +/** + * Make a directory. Creates the full path with folders in between + * Will throw if it fails + * + * @param p path to create + * @returns void + */ +export declare function mkdirP(p: string): void; +/** + * Resolves a sequence of paths or path segments into an absolute path. + * Calls node.js path.resolve() + * Allows L0 testing with consistent path formats on Mac/Linux and Windows in the mock implementation + * @param pathSegments + * @returns {string} + */ +export declare function resolve(...pathSegments: any[]): string; +export declare const which: typeof im._which; +/** + * Returns array of files in the given path, or in current directory if no path provided. See shelljs.ls + * @param {string} options Available options: -R (recursive), -A (all files, include files beginning with ., except for . and ..) + * @param {string[]} paths Paths to search. + * @return {string[]} An array of files in the given path(s). + */ +export declare function ls(options: string, paths: string[]): string[]; +/** + * Copies a file or folder. + * + * @param source source path + * @param dest destination path + * @param options string -r, -f or -rf for recursive and force + * @param continueOnError optional. whether to continue on error + * @param retryCount optional. Retry count to copy the file. It might help to resolve intermittent issues e.g. with UNC target paths on a remote host. + */ +export declare function cp(source: string, dest: string, options?: string, continueOnError?: boolean, retryCount?: number): void; +/** + * Moves a path. + * + * @param source source path + * @param dest destination path + * @param options string -f or -n for force and no clobber + * @param continueOnError optional. whether to continue on error + */ +export declare function mv(source: string, dest: string, options?: string, continueOnError?: boolean): void; +/** + * Interface for FindOptions + * Contains properties to control whether to follow symlinks + */ +export interface FindOptions { + /** + * When true, broken symbolic link will not cause an error. + */ + allowBrokenSymbolicLinks: boolean; + /** + * Equivalent to the -H command line option. Indicates whether to traverse descendants if + * the specified path is a symbolic link directory. Does not cause nested symbolic link + * directories to be traversed. + */ + followSpecifiedSymbolicLink: boolean; + /** + * Equivalent to the -L command line option. Indicates whether to traverse descendants of + * symbolic link directories. + */ + followSymbolicLinks: boolean; + /** + * When true, missing files will not cause an error and will be skipped. + */ + skipMissingFiles?: boolean; +} +/** + * Interface for RetryOptions + * + * Contains "continueOnError" and "retryCount" options. + */ +export interface RetryOptions { + /** + * If true, code still continues to execute when all retries failed. + */ + continueOnError: boolean; + /** + * Number of retries. + */ + retryCount: number; +} +/** + * Tries to execute a function a specified number of times. + * + * @param func a function to be executed. + * @param args executed function arguments array. + * @param retryOptions optional. Defaults to { continueOnError: false, retryCount: 0 }. + * @returns the same as the usual function. + */ +export declare function retry(func: Function, args: any[], retryOptions?: RetryOptions): any; +/** + * Recursively finds all paths a given path. Returns an array of paths. + * + * @param findPath path to search + * @param options optional. defaults to { followSymbolicLinks: true }. following soft links is generally appropriate unless deleting files. + * @returns string[] + */ +export declare function find(findPath: string, options?: FindOptions): string[]; +/** + * Prefer tl.find() and tl.match() instead. This function is for backward compatibility + * when porting tasks to Node from the PowerShell or PowerShell3 execution handler. + * + * @param rootDirectory path to root unrooted patterns with + * @param pattern include and exclude patterns + * @param includeFiles whether to include files in the result. defaults to true when includeFiles and includeDirectories are both false + * @param includeDirectories whether to include directories in the result + * @returns string[] + */ +export declare function legacyFindFiles(rootDirectory: string, pattern: string, includeFiles?: boolean, includeDirectories?: boolean): string[]; +/** + * Remove a path recursively with force + * + * @param inputPath path to remove + * @throws when the file or directory exists but could not be deleted. + */ +export declare function rmRF(inputPath: string): void; +/** + * Exec a tool. Convenience wrapper over ToolRunner to exec with args in one call. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param args an arg string or array of args + * @param options optional exec options. See IExecOptions + * @returns number + */ +export declare function exec(tool: string, args: any, options?: trm.IExecOptions): Q.Promise; +/** + * Exec a tool synchronously. Convenience wrapper over ToolRunner to execSync with args in one call. + * Output will be *not* be streamed to the live console. It will be returned after execution is complete. + * Appropriate for short running tools + * Returns IExecResult with output and return code + * + * @param tool path to tool to exec + * @param args an arg string or array of args + * @param options optional exec options. See IExecSyncOptions + * @returns IExecSyncResult + */ +export declare function execSync(tool: string, args: string | string[], options?: trm.IExecSyncOptions): trm.IExecSyncResult; +/** + * Convenience factory to create a ToolRunner. + * + * @param tool path to tool to exec + * @returns ToolRunner + */ +export declare function tool(tool: string): trm.ToolRunner; +export interface MatchOptions { + debug?: boolean; + nobrace?: boolean; + noglobstar?: boolean; + dot?: boolean; + noext?: boolean; + nocase?: boolean; + nonull?: boolean; + matchBase?: boolean; + nocomment?: boolean; + nonegate?: boolean; + flipNegate?: boolean; +} +/** + * Applies glob patterns to a list of paths. Supports interleaved exclude patterns. + * + * @param list array of paths + * @param patterns patterns to apply. supports interleaved exclude patterns. + * @param patternRoot optional. default root to apply to unrooted patterns. not applied to basename-only patterns when matchBase:true. + * @param options optional. defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' }. + */ +export declare function match(list: string[], patterns: string[] | string, patternRoot?: string, options?: MatchOptions): string[]; +/** + * Filter to apply glob patterns + * + * @param pattern pattern to apply + * @param options optional. defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' }. + */ +export declare function filter(pattern: string, options?: MatchOptions): (element: string, indexed: number, array: string[]) => boolean; +/** + * Determines the find root from a list of patterns. Performs the find and then applies the glob patterns. + * Supports interleaved exclude patterns. Unrooted patterns are rooted using defaultRoot, unless + * matchOptions.matchBase is specified and the pattern is a basename only. For matchBase cases, the + * defaultRoot is used as the find root. + * + * @param defaultRoot default path to root unrooted patterns. falls back to System.DefaultWorkingDirectory or process.cwd(). + * @param patterns pattern or array of patterns to apply + * @param findOptions defaults to { followSymbolicLinks: true }. following soft links is generally appropriate unless deleting files. + * @param matchOptions defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' } + */ +export declare function findMatch(defaultRoot: string, patterns: string[] | string, findOptions?: FindOptions, matchOptions?: MatchOptions): string[]; +export interface ProxyConfiguration { + proxyUrl: string; + /** + * Proxy URI formated as: protocol://username:password@hostname:port + * + * For tools that require setting proxy configuration in the single environment variable + */ + proxyFormattedUrl: string; + proxyUsername?: string; + proxyPassword?: string; + proxyBypassHosts?: string[]; +} +/** + * Gets http proxy configuration used by Build/Release agent + * + * @return ProxyConfiguration + */ +export declare function getHttpProxyConfiguration(requestUrl?: string): ProxyConfiguration | null; +export interface CertConfiguration { + caFile?: string; + certFile?: string; + keyFile?: string; + certArchiveFile?: string; + passphrase?: string; +} +/** + * Gets http certificate configuration used by Build/Release agent + * + * @return CertConfiguration + */ +export declare function getHttpCertConfiguration(): CertConfiguration | null; +export declare class TestPublisher { + testRunner: string; + constructor(testRunner: string); + publish(resultFiles?: string | string[], mergeResults?: string, platform?: string, config?: string, runTitle?: string, publishRunAttachments?: string, testRunSystem?: string): void; +} +export declare class CodeCoveragePublisher { + constructor(); + publish(codeCoverageTool?: string, summaryFileLocation?: string, reportDirectory?: string, additionalCodeCoverageFiles?: string | string[]): void; +} +export declare class CodeCoverageEnabler { + private buildTool; + private ccTool; + constructor(buildTool: string, ccTool: string); + enableCodeCoverage(buildProps: { + [key: string]: string; + }): void; +} +/** + * Upload user interested file as additional log information + * to the current timeline record. + * + * The file shall be available for download along with task logs. + * + * @param path Path to the file that should be uploaded. + * @returns void + */ +export declare function uploadFile(path: string): void; +/** + * Instruction for the agent to update the PATH environment variable. + * The specified directory is prepended to the PATH. + * The updated environment variable will be reflected in subsequent tasks. + * + * @param path Local directory path. + * @returns void + */ +export declare function prependPath(path: string): void; +/** + * Upload and attach summary markdown to current timeline record. + * This summary shall be added to the build/release summary and + * not available for download with logs. + * + * @param path Local directory path. + * @returns void + */ +export declare function uploadSummary(path: string): void; +/** + * Upload and attach attachment to current timeline record. + * These files are not available for download with logs. + * These can only be referred to by extensions using the type or name values. + * + * @param type Attachment type. + * @param name Attachment name. + * @param path Attachment path. + * @returns void + */ +export declare function addAttachment(type: string, name: string, path: string): void; +/** + * Set an endpoint field with given value. + * Value updated will be retained in the endpoint for + * the subsequent tasks that execute within the same job. + * + * @param id Endpoint id. + * @param field FieldType enum of AuthParameter, DataParameter or Url. + * @param key Key. + * @param value Value for key or url. + * @returns void + */ +export declare function setEndpoint(id: string, field: FieldType, key: string, value: string): void; +/** + * Set progress and current operation for current task. + * + * @param percent Percentage of completion. + * @param currentOperation Current pperation. + * @returns void + */ +export declare function setProgress(percent: number, currentOperation: string): void; +/** + * Indicates whether to write the logging command directly to the host or to the output pipeline. + * + * @param id Timeline record Guid. + * @param parentId Parent timeline record Guid. + * @param recordType Record type. + * @param recordName Record name. + * @param order Order of timeline record. + * @param startTime Start time. + * @param finishTime End time. + * @param progress Percentage of completion. + * @param state TaskState enum of Unknown, Initialized, InProgress or Completed. + * @param result TaskResult enum of Succeeded, SucceededWithIssues, Failed, Cancelled or Skipped. + * @param message current operation + * @returns void + */ +export declare function logDetail(id: string, message: string, parentId?: string, recordType?: string, recordName?: string, order?: number, startTime?: string, finishTime?: string, progress?: number, state?: TaskState, result?: TaskResult): void; +/** + * Log error or warning issue to timeline record of current task. + * + * @param type IssueType enum of Error or Warning. + * @param sourcePath Source file location. + * @param lineNumber Line number. + * @param columnNumber Column number. + * @param code Error or warning code. + * @param message Error or warning message. + * @returns void + */ +export declare function logIssue(type: IssueType, message: string, sourcePath?: string, lineNumber?: number, columnNumber?: number, errorCode?: string): void; +/** + * Upload user interested file as additional log information + * to the current timeline record. + * + * The file shall be available for download along with task logs. + * + * @param containerFolder Folder that the file will upload to, folder will be created if needed. + * @param path Path to the file that should be uploaded. + * @param name Artifact name. + * @returns void + */ +export declare function uploadArtifact(containerFolder: string, path: string, name?: string): void; +/** + * Create an artifact link, artifact location is required to be + * a file container path, VC path or UNC share path. + * + * The file shall be available for download along with task logs. + * + * @param name Artifact name. + * @param path Path to the file that should be associated. + * @param artifactType ArtifactType enum of Container, FilePath, VersionControl, GitRef or TfvcLabel. + * @returns void + */ +export declare function associateArtifact(name: string, path: string, artifactType: ArtifactType): void; +/** + * Upload user interested log to build’s container “logs\tool” folder. + * + * @param path Path to the file that should be uploaded. + * @returns void + */ +export declare function uploadBuildLog(path: string): void; +/** + * Update build number for current build. + * + * @param value Value to be assigned as the build number. + * @returns void + */ +export declare function updateBuildNumber(value: string): void; +/** + * Add a tag for current build. + * + * @param value Tag value. + * @returns void + */ +export declare function addBuildTag(value: string): void; +/** + * Update release name for current release. + * + * @param value Value to be assigned as the release name. + * @returns void + */ +export declare function updateReleaseName(name: string): void; diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/task.js b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/task.js new file mode 100644 index 0000000..fe0bf89 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/task.js @@ -0,0 +1,2004 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateReleaseName = exports.addBuildTag = exports.updateBuildNumber = exports.uploadBuildLog = exports.associateArtifact = exports.uploadArtifact = exports.logIssue = exports.logDetail = exports.setProgress = exports.setEndpoint = exports.addAttachment = exports.uploadSummary = exports.prependPath = exports.uploadFile = exports.CodeCoverageEnabler = exports.CodeCoveragePublisher = exports.TestPublisher = exports.getHttpCertConfiguration = exports.getHttpProxyConfiguration = exports.findMatch = exports.filter = exports.match = exports.tool = exports.execSync = exports.exec = exports.rmRF = exports.legacyFindFiles = exports.find = exports.retry = exports.mv = exports.cp = exports.ls = exports.which = exports.resolve = exports.mkdirP = exports.popd = exports.pushd = exports.cd = exports.checkPath = exports.cwd = exports.getPlatform = exports.osType = exports.writeFile = exports.exist = exports.stats = exports.debug = exports.error = exports.warning = exports.command = exports.setTaskVariable = exports.getTaskVariable = exports.getSecureFileTicket = exports.getSecureFileName = exports.getEndpointAuthorization = exports.getEndpointAuthorizationParameterRequired = exports.getEndpointAuthorizationParameter = exports.getEndpointAuthorizationSchemeRequired = exports.getEndpointAuthorizationScheme = exports.getEndpointDataParameterRequired = exports.getEndpointDataParameter = exports.getEndpointUrlRequired = exports.getEndpointUrl = exports.getPathInputRequired = exports.getPathInput = exports.filePathSupplied = exports.getDelimitedInput = exports.getBoolInput = exports.getInputRequired = exports.getInput = exports.setSecret = exports.setVariable = exports.getVariables = exports.assertAgent = exports.getVariable = exports.loc = exports.setResourcePath = exports.setResult = exports.setErrStream = exports.setStdStream = exports.Platform = exports.FieldType = exports.ArtifactType = exports.IssueType = exports.TaskState = exports.TaskResult = void 0; +var shell = require("shelljs"); +var childProcess = require("child_process"); +var fs = require("fs"); +var path = require("path"); +var os = require("os"); +var minimatch = require("minimatch"); +var im = require("./internal"); +var tcm = require("./taskcommand"); +var trm = require("./toolrunner"); +var semver = require("semver"); +var TaskResult; +(function (TaskResult) { + TaskResult[TaskResult["Succeeded"] = 0] = "Succeeded"; + TaskResult[TaskResult["SucceededWithIssues"] = 1] = "SucceededWithIssues"; + TaskResult[TaskResult["Failed"] = 2] = "Failed"; + TaskResult[TaskResult["Cancelled"] = 3] = "Cancelled"; + TaskResult[TaskResult["Skipped"] = 4] = "Skipped"; +})(TaskResult = exports.TaskResult || (exports.TaskResult = {})); +var TaskState; +(function (TaskState) { + TaskState[TaskState["Unknown"] = 0] = "Unknown"; + TaskState[TaskState["Initialized"] = 1] = "Initialized"; + TaskState[TaskState["InProgress"] = 2] = "InProgress"; + TaskState[TaskState["Completed"] = 3] = "Completed"; +})(TaskState = exports.TaskState || (exports.TaskState = {})); +var IssueType; +(function (IssueType) { + IssueType[IssueType["Error"] = 0] = "Error"; + IssueType[IssueType["Warning"] = 1] = "Warning"; +})(IssueType = exports.IssueType || (exports.IssueType = {})); +var ArtifactType; +(function (ArtifactType) { + ArtifactType[ArtifactType["Container"] = 0] = "Container"; + ArtifactType[ArtifactType["FilePath"] = 1] = "FilePath"; + ArtifactType[ArtifactType["VersionControl"] = 2] = "VersionControl"; + ArtifactType[ArtifactType["GitRef"] = 3] = "GitRef"; + ArtifactType[ArtifactType["TfvcLabel"] = 4] = "TfvcLabel"; +})(ArtifactType = exports.ArtifactType || (exports.ArtifactType = {})); +var FieldType; +(function (FieldType) { + FieldType[FieldType["AuthParameter"] = 0] = "AuthParameter"; + FieldType[FieldType["DataParameter"] = 1] = "DataParameter"; + FieldType[FieldType["Url"] = 2] = "Url"; +})(FieldType = exports.FieldType || (exports.FieldType = {})); +/** Platforms supported by our build agent */ +var Platform; +(function (Platform) { + Platform[Platform["Windows"] = 0] = "Windows"; + Platform[Platform["MacOS"] = 1] = "MacOS"; + Platform[Platform["Linux"] = 2] = "Linux"; +})(Platform = exports.Platform || (exports.Platform = {})); +//----------------------------------------------------- +// General Helpers +//----------------------------------------------------- +exports.setStdStream = im._setStdStream; +exports.setErrStream = im._setErrStream; +//----------------------------------------------------- +// Results +//----------------------------------------------------- +/** + * Sets the result of the task. + * Execution will continue. + * If not set, task will be Succeeded. + * If multiple calls are made to setResult the most pessimistic call wins (Failed) regardless of the order of calls. + * + * @param result TaskResult enum of Succeeded, SucceededWithIssues, Failed, Cancelled or Skipped. + * @param message A message which will be logged as an error issue if the result is Failed. + * @param done Optional. Instructs the agent the task is done. This is helpful when child processes + * may still be running and prevent node from fully exiting. This argument is supported + * from agent version 2.142.0 or higher (otherwise will no-op). + * @returns void + */ +function setResult(result, message, done) { + exports.debug('task result: ' + TaskResult[result]); + // add an error issue + if (result == TaskResult.Failed && message) { + exports.error(message); + } + else if (result == TaskResult.SucceededWithIssues && message) { + exports.warning(message); + } + // task.complete + var properties = { 'result': TaskResult[result] }; + if (done) { + properties['done'] = 'true'; + } + exports.command('task.complete', properties, message); +} +exports.setResult = setResult; +// +// Catching all exceptions +// +process.on('uncaughtException', function (err) { + setResult(TaskResult.Failed, exports.loc('LIB_UnhandledEx', err.message)); + exports.error(String(err.stack)); +}); +//----------------------------------------------------- +// Loc Helpers +//----------------------------------------------------- +exports.setResourcePath = im._setResourcePath; +exports.loc = im._loc; +//----------------------------------------------------- +// Input Helpers +//----------------------------------------------------- +exports.getVariable = im._getVariable; +/** + * Asserts the agent version is at least the specified minimum. + * + * @param minimum minimum version version - must be 2.104.1 or higher + */ +function assertAgent(minimum) { + if (semver.lt(minimum, '2.104.1')) { + throw new Error('assertAgent() requires the parameter to be 2.104.1 or higher'); + } + var agent = exports.getVariable('Agent.Version'); + if (agent && semver.lt(agent, minimum)) { + throw new Error("Agent version " + minimum + " or higher is required"); + } +} +exports.assertAgent = assertAgent; +/** + * Gets a snapshot of the current state of all job variables available to the task. + * Requires a 2.104.1 agent or higher for full functionality. + * + * Limitations on an agent prior to 2.104.1: + * 1) The return value does not include all public variables. Only public variables + * that have been added using setVariable are returned. + * 2) The name returned for each secret variable is the formatted environment variable + * name, not the actual variable name (unless it was set explicitly at runtime using + * setVariable). + * + * @returns VariableInfo[] + */ +function getVariables() { + return Object.keys(im._knownVariableMap) + .map(function (key) { + var info = im._knownVariableMap[key]; + return { name: info.name, value: exports.getVariable(info.name), secret: info.secret }; + }); +} +exports.getVariables = getVariables; +/** + * Sets a variable which will be available to subsequent tasks as well. + * + * @param name name of the variable to set + * @param val value to set + * @param secret whether variable is secret. Multi-line secrets are not allowed. Optional, defaults to false + * @param isOutput whether variable is an output variable. Optional, defaults to false + * @returns void + */ +function setVariable(name, val, secret, isOutput) { + if (secret === void 0) { secret = false; } + if (isOutput === void 0) { isOutput = false; } + // once a secret always a secret + var key = im._getVariableKey(name); + if (im._knownVariableMap.hasOwnProperty(key)) { + secret = secret || im._knownVariableMap[key].secret; + } + // store the value + var varValue = val || ''; + exports.debug('set ' + name + '=' + (secret && varValue ? '********' : varValue)); + if (secret) { + if (varValue && varValue.match(/\r|\n/) && ("" + process.env['SYSTEM_UNSAFEALLOWMULTILINESECRET']).toUpperCase() != 'TRUE') { + throw new Error(exports.loc('LIB_MultilineSecret')); + } + im._vault.storeSecret('SECRET_' + key, varValue); + delete process.env[key]; + } + else { + process.env[key] = varValue; + } + // store the metadata + im._knownVariableMap[key] = { name: name, secret: secret }; + // write the setvariable command + exports.command('task.setvariable', { 'variable': name || '', isOutput: (isOutput || false).toString(), 'issecret': (secret || false).toString() }, varValue); +} +exports.setVariable = setVariable; +/** + * Registers a value with the logger, so the value will be masked from the logs. Multi-line secrets are not allowed. + * + * @param val value to register + */ +function setSecret(val) { + if (val) { + if (val.match(/\r|\n/) && ("" + process.env['SYSTEM_UNSAFEALLOWMULTILINESECRET']).toUpperCase() !== 'TRUE') { + throw new Error(exports.loc('LIB_MultilineSecret')); + } + exports.command('task.setsecret', {}, val); + } +} +exports.setSecret = setSecret; +/** + * Gets the value of an input. + * If required is true and the value is not set, it will throw. + * + * @param name name of the input to get + * @param required whether input is required. optional, defaults to false + * @returns string + */ +function getInput(name, required) { + var inval = im._vault.retrieveSecret('INPUT_' + im._getVariableKey(name)); + if (required && !inval) { + throw new Error(exports.loc('LIB_InputRequired', name)); + } + exports.debug(name + '=' + inval); + return inval; +} +exports.getInput = getInput; +/** + * Gets the value of an input. + * If the value is not set, it will throw. + * + * @param name name of the input to get + * @returns string + */ +function getInputRequired(name) { + return getInput(name, true); +} +exports.getInputRequired = getInputRequired; +/** + * Gets the value of an input and converts to a bool. Convenience. + * If required is true and the value is not set, it will throw. + * If required is false and the value is not set, returns false. + * + * @param name name of the bool input to get + * @param required whether input is required. optional, defaults to false + * @returns boolean + */ +function getBoolInput(name, required) { + return (getInput(name, required) || '').toUpperCase() == "TRUE"; +} +exports.getBoolInput = getBoolInput; +/** + * Gets the value of an input and splits the value using a delimiter (space, comma, etc). + * Empty values are removed. This function is useful for splitting an input containing a simple + * list of items - such as build targets. + * IMPORTANT: Do not use this function for splitting additional args! Instead use argString(), which + * follows normal argument splitting rules and handles values encapsulated by quotes. + * If required is true and the value is not set, it will throw. + * + * @param name name of the input to get + * @param delim delimiter to split on + * @param required whether input is required. optional, defaults to false + * @returns string[] + */ +function getDelimitedInput(name, delim, required) { + var inputVal = getInput(name, required); + if (!inputVal) { + return []; + } + var result = []; + inputVal.split(delim).forEach(function (x) { + if (x) { + result.push(x); + } + }); + return result; +} +exports.getDelimitedInput = getDelimitedInput; +/** + * Checks whether a path inputs value was supplied by the user + * File paths are relative with a picker, so an empty path is the root of the repo. + * Useful if you need to condition work (like append an arg) if a value was supplied + * + * @param name name of the path input to check + * @returns boolean + */ +function filePathSupplied(name) { + // normalize paths + var pathValue = this.resolve(this.getPathInput(name) || ''); + var repoRoot = this.resolve(exports.getVariable('build.sourcesDirectory') || exports.getVariable('system.defaultWorkingDirectory') || ''); + var supplied = pathValue !== repoRoot; + exports.debug(name + 'path supplied :' + supplied); + return supplied; +} +exports.filePathSupplied = filePathSupplied; +/** + * Gets the value of a path input + * It will be quoted for you if it isn't already and contains spaces + * If required is true and the value is not set, it will throw. + * If check is true and the path does not exist, it will throw. + * + * @param name name of the input to get + * @param required whether input is required. optional, defaults to false + * @param check whether path is checked. optional, defaults to false + * @returns string + */ +function getPathInput(name, required, check) { + var inval = getInput(name, required); + if (inval) { + if (check) { + exports.checkPath(inval, name); + } + } + return inval; +} +exports.getPathInput = getPathInput; +/** + * Gets the value of a path input + * It will be quoted for you if it isn't already and contains spaces + * If the value is not set, it will throw. + * If check is true and the path does not exist, it will throw. + * + * @param name name of the input to get + * @param check whether path is checked. optional, defaults to false + * @returns string + */ +function getPathInputRequired(name, check) { + return getPathInput(name, true, check); +} +exports.getPathInputRequired = getPathInputRequired; +//----------------------------------------------------- +// Endpoint Helpers +//----------------------------------------------------- +/** + * Gets the url for a service endpoint + * If the url was not set and is not optional, it will throw. + * + * @param id name of the service endpoint + * @param optional whether the url is optional + * @returns string + */ +function getEndpointUrl(id, optional) { + var urlval = process.env['ENDPOINT_URL_' + id]; + if (!optional && !urlval) { + throw new Error(exports.loc('LIB_EndpointNotExist', id)); + } + exports.debug(id + '=' + urlval); + return urlval; +} +exports.getEndpointUrl = getEndpointUrl; +/** + * Gets the url for a service endpoint + * If the url was not set, it will throw. + * + * @param id name of the service endpoint + * @returns string + */ +function getEndpointUrlRequired(id) { + return getEndpointUrl(id, false); +} +exports.getEndpointUrlRequired = getEndpointUrlRequired; +/* + * Gets the endpoint data parameter value with specified key for a service endpoint + * If the endpoint data parameter was not set and is not optional, it will throw. + * + * @param id name of the service endpoint + * @param key of the parameter + * @param optional whether the endpoint data is optional + * @returns {string} value of the endpoint data parameter + */ +function getEndpointDataParameter(id, key, optional) { + var dataParamVal = process.env['ENDPOINT_DATA_' + id + '_' + key.toUpperCase()]; + if (!optional && !dataParamVal) { + throw new Error(exports.loc('LIB_EndpointDataNotExist', id, key)); + } + exports.debug(id + ' data ' + key + ' = ' + dataParamVal); + return dataParamVal; +} +exports.getEndpointDataParameter = getEndpointDataParameter; +/* + * Gets the endpoint data parameter value with specified key for a service endpoint + * If the endpoint data parameter was not set, it will throw. + * + * @param id name of the service endpoint + * @param key of the parameter + * @returns {string} value of the endpoint data parameter + */ +function getEndpointDataParameterRequired(id, key) { + return getEndpointDataParameter(id, key, false); +} +exports.getEndpointDataParameterRequired = getEndpointDataParameterRequired; +/** + * Gets the endpoint authorization scheme for a service endpoint + * If the endpoint authorization scheme is not set and is not optional, it will throw. + * + * @param id name of the service endpoint + * @param optional whether the endpoint authorization scheme is optional + * @returns {string} value of the endpoint authorization scheme + */ +function getEndpointAuthorizationScheme(id, optional) { + var authScheme = im._vault.retrieveSecret('ENDPOINT_AUTH_SCHEME_' + id); + if (!optional && !authScheme) { + throw new Error(exports.loc('LIB_EndpointAuthNotExist', id)); + } + exports.debug(id + ' auth scheme = ' + authScheme); + return authScheme; +} +exports.getEndpointAuthorizationScheme = getEndpointAuthorizationScheme; +/** + * Gets the endpoint authorization scheme for a service endpoint + * If the endpoint authorization scheme is not set, it will throw. + * + * @param id name of the service endpoint + * @returns {string} value of the endpoint authorization scheme + */ +function getEndpointAuthorizationSchemeRequired(id) { + return getEndpointAuthorizationScheme(id, false); +} +exports.getEndpointAuthorizationSchemeRequired = getEndpointAuthorizationSchemeRequired; +/** + * Gets the endpoint authorization parameter value for a service endpoint with specified key + * If the endpoint authorization parameter is not set and is not optional, it will throw. + * + * @param id name of the service endpoint + * @param key key to find the endpoint authorization parameter + * @param optional optional whether the endpoint authorization scheme is optional + * @returns {string} value of the endpoint authorization parameter value + */ +function getEndpointAuthorizationParameter(id, key, optional) { + var authParam = im._vault.retrieveSecret('ENDPOINT_AUTH_PARAMETER_' + id + '_' + key.toUpperCase()); + if (!optional && !authParam) { + throw new Error(exports.loc('LIB_EndpointAuthNotExist', id)); + } + exports.debug(id + ' auth param ' + key + ' = ' + authParam); + return authParam; +} +exports.getEndpointAuthorizationParameter = getEndpointAuthorizationParameter; +/** + * Gets the endpoint authorization parameter value for a service endpoint with specified key + * If the endpoint authorization parameter is not set, it will throw. + * + * @param id name of the service endpoint + * @param key key to find the endpoint authorization parameter + * @returns {string} value of the endpoint authorization parameter value + */ +function getEndpointAuthorizationParameterRequired(id, key) { + return getEndpointAuthorizationParameter(id, key, false); +} +exports.getEndpointAuthorizationParameterRequired = getEndpointAuthorizationParameterRequired; +/** + * Gets the authorization details for a service endpoint + * If the authorization was not set and is not optional, it will set the task result to Failed. + * + * @param id name of the service endpoint + * @param optional whether the url is optional + * @returns string + */ +function getEndpointAuthorization(id, optional) { + var aval = im._vault.retrieveSecret('ENDPOINT_AUTH_' + id); + if (!optional && !aval) { + setResult(TaskResult.Failed, exports.loc('LIB_EndpointAuthNotExist', id)); + } + exports.debug(id + ' exists ' + (!!aval)); + var auth; + try { + if (aval) { + auth = JSON.parse(aval); + } + } + catch (err) { + throw new Error(exports.loc('LIB_InvalidEndpointAuth', aval)); + } + return auth; +} +exports.getEndpointAuthorization = getEndpointAuthorization; +//----------------------------------------------------- +// SecureFile Helpers +//----------------------------------------------------- +/** + * Gets the name for a secure file + * + * @param id secure file id + * @returns string + */ +function getSecureFileName(id) { + var name = process.env['SECUREFILE_NAME_' + id]; + exports.debug('secure file name for id ' + id + ' = ' + name); + return name; +} +exports.getSecureFileName = getSecureFileName; +/** + * Gets the secure file ticket that can be used to download the secure file contents + * + * @param id name of the secure file + * @returns {string} secure file ticket + */ +function getSecureFileTicket(id) { + var ticket = im._vault.retrieveSecret('SECUREFILE_TICKET_' + id); + exports.debug('secure file ticket for id ' + id + ' = ' + ticket); + return ticket; +} +exports.getSecureFileTicket = getSecureFileTicket; +//----------------------------------------------------- +// Task Variable Helpers +//----------------------------------------------------- +/** + * Gets a variable value that is set by previous step from the same wrapper task. + * Requires a 2.115.0 agent or higher. + * + * @param name name of the variable to get + * @returns string + */ +function getTaskVariable(name) { + assertAgent('2.115.0'); + var inval = im._vault.retrieveSecret('VSTS_TASKVARIABLE_' + im._getVariableKey(name)); + if (inval) { + inval = inval.trim(); + } + exports.debug('task variable: ' + name + '=' + inval); + return inval; +} +exports.getTaskVariable = getTaskVariable; +/** + * Sets a task variable which will only be available to subsequent steps belong to the same wrapper task. + * Requires a 2.115.0 agent or higher. + * + * @param name name of the variable to set + * @param val value to set + * @param secret whether variable is secret. optional, defaults to false + * @returns void + */ +function setTaskVariable(name, val, secret) { + if (secret === void 0) { secret = false; } + assertAgent('2.115.0'); + var key = im._getVariableKey(name); + // store the value + var varValue = val || ''; + exports.debug('set task variable: ' + name + '=' + (secret && varValue ? '********' : varValue)); + im._vault.storeSecret('VSTS_TASKVARIABLE_' + key, varValue); + delete process.env[key]; + // write the command + exports.command('task.settaskvariable', { 'variable': name || '', 'issecret': (secret || false).toString() }, varValue); +} +exports.setTaskVariable = setTaskVariable; +//----------------------------------------------------- +// Cmd Helpers +//----------------------------------------------------- +exports.command = im._command; +exports.warning = im._warning; +exports.error = im._error; +exports.debug = im._debug; +//----------------------------------------------------- +// Disk Functions +//----------------------------------------------------- +function _checkShell(cmd, continueOnError) { + var se = shell.error(); + if (se) { + exports.debug(cmd + ' failed'); + var errMsg = exports.loc('LIB_OperationFailed', cmd, se); + exports.debug(errMsg); + if (!continueOnError) { + throw new Error(errMsg); + } + } +} +/** + * Get's stat on a path. + * Useful for checking whether a file or directory. Also getting created, modified and accessed time. + * see [fs.stat](https://nodejs.org/api/fs.html#fs_class_fs_stats) + * + * @param path path to check + * @returns fsStat + */ +function stats(path) { + return fs.statSync(path); +} +exports.stats = stats; +exports.exist = im._exist; +function writeFile(file, data, options) { + if (typeof (options) === 'string') { + fs.writeFileSync(file, data, { encoding: options }); + } + else { + fs.writeFileSync(file, data, options); + } +} +exports.writeFile = writeFile; +/** + * @deprecated Use `getPlatform` + * Useful for determining the host operating system. + * see [os.type](https://nodejs.org/api/os.html#os_os_type) + * + * @return the name of the operating system + */ +function osType() { + return os.type(); +} +exports.osType = osType; +/** + * Determine the operating system the build agent is running on. + * @returns {Platform} + * @throws {Error} Platform is not supported by our agent + */ +function getPlatform() { + switch (process.platform) { + case 'win32': return Platform.Windows; + case 'darwin': return Platform.MacOS; + case 'linux': return Platform.Linux; + default: throw Error(exports.loc('LIB_PlatformNotSupported', process.platform)); + } +} +exports.getPlatform = getPlatform; +/** + * Returns the process's current working directory. + * see [process.cwd](https://nodejs.org/api/process.html#process_process_cwd) + * + * @return the path to the current working directory of the process + */ +function cwd() { + return process.cwd(); +} +exports.cwd = cwd; +exports.checkPath = im._checkPath; +/** + * Change working directory. + * + * @param path new working directory path + * @returns void + */ +function cd(path) { + if (path) { + shell.cd(path); + _checkShell('cd'); + } +} +exports.cd = cd; +/** + * Change working directory and push it on the stack + * + * @param path new working directory path + * @returns void + */ +function pushd(path) { + shell.pushd(path); + _checkShell('pushd'); +} +exports.pushd = pushd; +/** + * Change working directory back to previously pushed directory + * + * @returns void + */ +function popd() { + shell.popd(); + _checkShell('popd'); +} +exports.popd = popd; +/** + * Make a directory. Creates the full path with folders in between + * Will throw if it fails + * + * @param p path to create + * @returns void + */ +function mkdirP(p) { + if (!p) { + throw new Error(exports.loc('LIB_ParameterIsRequired', 'p')); + } + // build a stack of directories to create + var stack = []; + var testDir = p; + while (true) { + // validate the loop is not out of control + if (stack.length >= (process.env['TASKLIB_TEST_MKDIRP_FAILSAFE'] || 1000)) { + // let the framework throw + exports.debug('loop is out of control'); + fs.mkdirSync(p); + return; + } + exports.debug("testing directory '" + testDir + "'"); + var stats_1 = void 0; + try { + stats_1 = fs.statSync(testDir); + } + catch (err) { + if (err.code == 'ENOENT') { + // validate the directory is not the drive root + var parentDir = path.dirname(testDir); + if (testDir == parentDir) { + throw new Error(exports.loc('LIB_MkdirFailedInvalidDriveRoot', p, testDir)); // Unable to create directory '{p}'. Root directory does not exist: '{testDir}' + } + // push the dir and test the parent + stack.push(testDir); + testDir = parentDir; + continue; + } + else if (err.code == 'UNKNOWN') { + throw new Error(exports.loc('LIB_MkdirFailedInvalidShare', p, testDir)); // Unable to create directory '{p}'. Unable to verify the directory exists: '{testDir}'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share. + } + else { + throw err; + } + } + if (!stats_1.isDirectory()) { + throw new Error(exports.loc('LIB_MkdirFailedFileExists', p, testDir)); // Unable to create directory '{p}'. Conflicting file exists: '{testDir}' + } + // testDir exists + break; + } + // create each directory + while (stack.length) { + var dir = stack.pop(); // non-null because `stack.length` was truthy + exports.debug("mkdir '" + dir + "'"); + try { + fs.mkdirSync(dir); + } + catch (err) { + throw new Error(exports.loc('LIB_MkdirFailed', p, err.message)); // Unable to create directory '{p}'. {err.message} + } + } +} +exports.mkdirP = mkdirP; +/** + * Resolves a sequence of paths or path segments into an absolute path. + * Calls node.js path.resolve() + * Allows L0 testing with consistent path formats on Mac/Linux and Windows in the mock implementation + * @param pathSegments + * @returns {string} + */ +function resolve() { + var pathSegments = []; + for (var _i = 0; _i < arguments.length; _i++) { + pathSegments[_i] = arguments[_i]; + } + var absolutePath = path.resolve.apply(this, pathSegments); + exports.debug('Absolute path for pathSegments: ' + pathSegments + ' = ' + absolutePath); + return absolutePath; +} +exports.resolve = resolve; +exports.which = im._which; +/** + * Returns array of files in the given path, or in current directory if no path provided. See shelljs.ls + * @param {string} options Available options: -R (recursive), -A (all files, include files beginning with ., except for . and ..) + * @param {string[]} paths Paths to search. + * @return {string[]} An array of files in the given path(s). + */ +function ls(options, paths) { + if (options) { + return shell.ls(options, paths); + } + else { + return shell.ls(paths); + } +} +exports.ls = ls; +/** + * Copies a file or folder. + * + * @param source source path + * @param dest destination path + * @param options string -r, -f or -rf for recursive and force + * @param continueOnError optional. whether to continue on error + * @param retryCount optional. Retry count to copy the file. It might help to resolve intermittent issues e.g. with UNC target paths on a remote host. + */ +function cp(source, dest, options, continueOnError, retryCount) { + if (retryCount === void 0) { retryCount = 0; } + while (retryCount >= 0) { + try { + if (options) { + shell.cp(options, source, dest); + } + else { + shell.cp(source, dest); + } + _checkShell('cp', false); + break; + } + catch (e) { + if (retryCount <= 0) { + if (continueOnError) { + exports.warning(e); + break; + } + else { + throw e; + } + } + else { + console.log(exports.loc('LIB_CopyFileFailed', retryCount)); + retryCount--; + } + } + } +} +exports.cp = cp; +/** + * Moves a path. + * + * @param source source path + * @param dest destination path + * @param options string -f or -n for force and no clobber + * @param continueOnError optional. whether to continue on error + */ +function mv(source, dest, options, continueOnError) { + if (options) { + shell.mv(options, source, dest); + } + else { + shell.mv(source, dest); + } + _checkShell('mv', continueOnError); +} +exports.mv = mv; +/** + * Tries to execute a function a specified number of times. + * + * @param func a function to be executed. + * @param args executed function arguments array. + * @param retryOptions optional. Defaults to { continueOnError: false, retryCount: 0 }. + * @returns the same as the usual function. + */ +function retry(func, args, retryOptions) { + if (retryOptions === void 0) { retryOptions = { continueOnError: false, retryCount: 0 }; } + while (retryOptions.retryCount >= 0) { + try { + return func.apply(void 0, args); + } + catch (e) { + if (retryOptions.retryCount <= 0) { + if (retryOptions.continueOnError) { + exports.warning(e); + break; + } + else { + throw e; + } + } + else { + exports.debug("Attempt to execute function \"" + (func === null || func === void 0 ? void 0 : func.name) + "\" failed, retries left: " + retryOptions.retryCount); + retryOptions.retryCount--; + } + } + } +} +exports.retry = retry; +/** + * Gets info about item stats. + * + * @param path a path to the item to be processed. + * @param followSymbolicLink indicates whether to traverse descendants of symbolic link directories. + * @param allowBrokenSymbolicLinks when true, broken symbolic link will not cause an error. + * @returns fs.Stats + */ +function _getStats(path, followSymbolicLink, allowBrokenSymbolicLinks) { + // stat returns info about the target of a symlink (or symlink chain), + // lstat returns info about a symlink itself + var stats; + if (followSymbolicLink) { + try { + // use stat (following symlinks) + stats = fs.statSync(path); + } + catch (err) { + if (err.code == 'ENOENT' && allowBrokenSymbolicLinks) { + // fallback to lstat (broken symlinks allowed) + stats = fs.lstatSync(path); + exports.debug(" " + path + " (broken symlink)"); + } + else { + throw err; + } + } + } + else { + // use lstat (not following symlinks) + stats = fs.lstatSync(path); + } + return stats; +} +/** + * Recursively finds all paths a given path. Returns an array of paths. + * + * @param findPath path to search + * @param options optional. defaults to { followSymbolicLinks: true }. following soft links is generally appropriate unless deleting files. + * @returns string[] + */ +function find(findPath, options) { + if (!findPath) { + exports.debug('no path specified'); + return []; + } + // normalize the path, otherwise the first result is inconsistently formatted from the rest of the results + // because path.join() performs normalization. + findPath = path.normalize(findPath); + // debug trace the parameters + exports.debug("findPath: '" + findPath + "'"); + options = options || _getDefaultFindOptions(); + _debugFindOptions(options); + // return empty if not exists + try { + fs.lstatSync(findPath); + } + catch (err) { + if (err.code == 'ENOENT') { + exports.debug('0 results'); + return []; + } + throw err; + } + try { + var result = []; + // push the first item + var stack = [new _FindItem(findPath, 1)]; + var traversalChain = []; // used to detect cycles + var _loop_1 = function () { + // pop the next item and push to the result array + var item = stack.pop(); // non-null because `stack.length` was truthy + var stats_2 = void 0; + try { + // `item.path` equals `findPath` for the first item to be processed, when the `result` array is empty + var isPathToSearch = !result.length; + // following specified symlinks only if current path equals specified path + var followSpecifiedSymbolicLink = options.followSpecifiedSymbolicLink && isPathToSearch; + // following all symlinks or following symlink for the specified path + var followSymbolicLink = options.followSymbolicLinks || followSpecifiedSymbolicLink; + // stat the item. The stat info is used further below to determine whether to traverse deeper + stats_2 = _getStats(item.path, followSymbolicLink, options.allowBrokenSymbolicLinks); + } + catch (err) { + if (err.code == 'ENOENT' && options.skipMissingFiles) { + exports.warning("No such file or directory: \"" + item.path + "\" - skipping."); + return "continue"; + } + throw err; + } + result.push(item.path); + // note, isDirectory() returns false for the lstat of a symlink + if (stats_2.isDirectory()) { + exports.debug(" " + item.path + " (directory)"); + if (options.followSymbolicLinks) { + // get the realpath + var realPath_1; + if (im._isUncPath(item.path)) { + // Sometimes there are spontaneous issues when working with unc-paths, so retries have been added for them. + realPath_1 = retry(fs.realpathSync, [item.path], { continueOnError: false, retryCount: 5 }); + } + else { + realPath_1 = fs.realpathSync(item.path); + } + // fixup the traversal chain to match the item level + while (traversalChain.length >= item.level) { + traversalChain.pop(); + } + // test for a cycle + if (traversalChain.some(function (x) { return x == realPath_1; })) { + exports.debug(' cycle detected'); + return "continue"; + } + // update the traversal chain + traversalChain.push(realPath_1); + } + // push the child items in reverse onto the stack + var childLevel_1 = item.level + 1; + var childItems = fs.readdirSync(item.path) + .map(function (childName) { return new _FindItem(path.join(item.path, childName), childLevel_1); }); + for (var i = childItems.length - 1; i >= 0; i--) { + stack.push(childItems[i]); + } + } + else { + exports.debug(" " + item.path + " (file)"); + } + }; + while (stack.length) { + _loop_1(); + } + exports.debug(result.length + " results"); + return result; + } + catch (err) { + throw new Error(exports.loc('LIB_OperationFailed', 'find', err.message)); + } +} +exports.find = find; +var _FindItem = /** @class */ (function () { + function _FindItem(path, level) { + this.path = path; + this.level = level; + } + return _FindItem; +}()); +function _debugFindOptions(options) { + exports.debug("findOptions.allowBrokenSymbolicLinks: '" + options.allowBrokenSymbolicLinks + "'"); + exports.debug("findOptions.followSpecifiedSymbolicLink: '" + options.followSpecifiedSymbolicLink + "'"); + exports.debug("findOptions.followSymbolicLinks: '" + options.followSymbolicLinks + "'"); + exports.debug("findOptions.skipMissingFiles: '" + options.skipMissingFiles + "'"); +} +function _getDefaultFindOptions() { + return { + allowBrokenSymbolicLinks: false, + followSpecifiedSymbolicLink: true, + followSymbolicLinks: true, + skipMissingFiles: false + }; +} +/** + * Prefer tl.find() and tl.match() instead. This function is for backward compatibility + * when porting tasks to Node from the PowerShell or PowerShell3 execution handler. + * + * @param rootDirectory path to root unrooted patterns with + * @param pattern include and exclude patterns + * @param includeFiles whether to include files in the result. defaults to true when includeFiles and includeDirectories are both false + * @param includeDirectories whether to include directories in the result + * @returns string[] + */ +function legacyFindFiles(rootDirectory, pattern, includeFiles, includeDirectories) { + if (!pattern) { + throw new Error('pattern parameter cannot be empty'); + } + exports.debug("legacyFindFiles rootDirectory: '" + rootDirectory + "'"); + exports.debug("pattern: '" + pattern + "'"); + exports.debug("includeFiles: '" + includeFiles + "'"); + exports.debug("includeDirectories: '" + includeDirectories + "'"); + if (!includeFiles && !includeDirectories) { + includeFiles = true; + } + // organize the patterns into include patterns and exclude patterns + var includePatterns = []; + var excludePatterns = []; + pattern = pattern.replace(/;;/g, '\0'); + for (var _i = 0, _a = pattern.split(';'); _i < _a.length; _i++) { + var pat = _a[_i]; + if (!pat) { + continue; + } + pat = pat.replace(/\0/g, ';'); + // determine whether include pattern and remove any include/exclude prefix. + // include patterns start with +: or anything other than -: + // exclude patterns start with -: + var isIncludePattern = void 0; + if (im._startsWith(pat, '+:')) { + pat = pat.substring(2); + isIncludePattern = true; + } + else if (im._startsWith(pat, '-:')) { + pat = pat.substring(2); + isIncludePattern = false; + } + else { + isIncludePattern = true; + } + // validate pattern does not end with a slash + if (im._endsWith(pat, '/') || (process.platform == 'win32' && im._endsWith(pat, '\\'))) { + throw new Error(exports.loc('LIB_InvalidPattern', pat)); + } + // root the pattern + if (rootDirectory && !path.isAbsolute(pat)) { + pat = path.join(rootDirectory, pat); + // remove trailing slash sometimes added by path.join() on Windows, e.g. + // path.join('\\\\hello', 'world') => '\\\\hello\\world\\' + // path.join('//hello', 'world') => '\\\\hello\\world\\' + if (im._endsWith(pat, '\\')) { + pat = pat.substring(0, pat.length - 1); + } + } + if (isIncludePattern) { + includePatterns.push(pat); + } + else { + excludePatterns.push(im._legacyFindFiles_convertPatternToRegExp(pat)); + } + } + // find and apply patterns + var count = 0; + var result = _legacyFindFiles_getMatchingItems(includePatterns, excludePatterns, !!includeFiles, !!includeDirectories); + exports.debug('all matches:'); + for (var _b = 0, result_1 = result; _b < result_1.length; _b++) { + var resultItem = result_1[_b]; + exports.debug(' ' + resultItem); + } + exports.debug('total matched: ' + result.length); + return result; +} +exports.legacyFindFiles = legacyFindFiles; +function _legacyFindFiles_getMatchingItems(includePatterns, excludePatterns, includeFiles, includeDirectories) { + exports.debug('getMatchingItems()'); + for (var _i = 0, includePatterns_1 = includePatterns; _i < includePatterns_1.length; _i++) { + var pattern = includePatterns_1[_i]; + exports.debug("includePattern: '" + pattern + "'"); + } + for (var _a = 0, excludePatterns_1 = excludePatterns; _a < excludePatterns_1.length; _a++) { + var pattern = excludePatterns_1[_a]; + exports.debug("excludePattern: " + pattern); + } + exports.debug('includeFiles: ' + includeFiles); + exports.debug('includeDirectories: ' + includeDirectories); + var allFiles = {}; + var _loop_2 = function (pattern) { + // determine the directory to search + // + // note, getDirectoryName removes redundant path separators + var findPath = void 0; + var starIndex = pattern.indexOf('*'); + var questionIndex = pattern.indexOf('?'); + if (starIndex < 0 && questionIndex < 0) { + // if no wildcards are found, use the directory name portion of the path. + // if there is no directory name (file name only in pattern or drive root), + // this will return empty string. + findPath = im._getDirectoryName(pattern); + } + else { + // extract the directory prior to the first wildcard + var index = Math.min(starIndex >= 0 ? starIndex : questionIndex, questionIndex >= 0 ? questionIndex : starIndex); + findPath = im._getDirectoryName(pattern.substring(0, index)); + } + // note, due to this short-circuit and the above usage of getDirectoryName, this + // function has the same limitations regarding drive roots as the powershell + // implementation. + // + // also note, since getDirectoryName eliminates slash redundancies, some additional + // work may be required if removal of this limitation is attempted. + if (!findPath) { + return "continue"; + } + var patternRegex = im._legacyFindFiles_convertPatternToRegExp(pattern); + // find files/directories + var items = find(findPath, { followSymbolicLinks: true }) + .filter(function (item) { + if (includeFiles && includeDirectories) { + return true; + } + var isDir = fs.statSync(item).isDirectory(); + return (includeFiles && !isDir) || (includeDirectories && isDir); + }) + .forEach(function (item) { + var normalizedPath = process.platform == 'win32' ? item.replace(/\\/g, '/') : item; // normalize separators + // **/times/** will not match C:/fun/times because there isn't a trailing slash + // so try both if including directories + var alternatePath = normalizedPath + "/"; // potential bug: it looks like this will result in a false + // positive if the item is a regular file and not a directory + var isMatch = false; + if (patternRegex.test(normalizedPath) || (includeDirectories && patternRegex.test(alternatePath))) { + isMatch = true; + // test whether the path should be excluded + for (var _i = 0, excludePatterns_2 = excludePatterns; _i < excludePatterns_2.length; _i++) { + var regex = excludePatterns_2[_i]; + if (regex.test(normalizedPath) || (includeDirectories && regex.test(alternatePath))) { + isMatch = false; + break; + } + } + } + if (isMatch) { + allFiles[item] = item; + } + }); + }; + for (var _b = 0, includePatterns_2 = includePatterns; _b < includePatterns_2.length; _b++) { + var pattern = includePatterns_2[_b]; + _loop_2(pattern); + } + return Object.keys(allFiles).sort(); +} +/** + * Remove a path recursively with force + * + * @param inputPath path to remove + * @throws when the file or directory exists but could not be deleted. + */ +function rmRF(inputPath) { + exports.debug('rm -rf ' + inputPath); + if (getPlatform() == Platform.Windows) { + // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another + // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. + try { + if (fs.statSync(inputPath).isDirectory()) { + exports.debug('removing directory ' + inputPath); + childProcess.execSync("rd /s /q \"" + inputPath + "\""); + } + else { + exports.debug('removing file ' + inputPath); + childProcess.execSync("del /f /a \"" + inputPath + "\""); + } + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code != 'ENOENT') { + throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', err.message)); + } + } + // Shelling out fails to remove a symlink folder with missing source, this unlink catches that + try { + fs.unlinkSync(inputPath); + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code != 'ENOENT') { + throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', err.message)); + } + } + } + else { + // get the lstats in order to workaround a bug in shelljs@0.3.0 where symlinks + // with missing targets are not handled correctly by "rm('-rf', path)" + var lstats = void 0; + try { + lstats = fs.lstatSync(inputPath); + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code == 'ENOENT') { + return; + } + throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', err.message)); + } + if (lstats.isDirectory()) { + exports.debug('removing directory'); + shell.rm('-rf', inputPath); + var errMsg = shell.error(); + if (errMsg) { + throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', errMsg)); + } + return; + } + exports.debug('removing file'); + try { + fs.unlinkSync(inputPath); + } + catch (err) { + throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', err.message)); + } + } +} +exports.rmRF = rmRF; +/** + * Exec a tool. Convenience wrapper over ToolRunner to exec with args in one call. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param args an arg string or array of args + * @param options optional exec options. See IExecOptions + * @returns number + */ +function exec(tool, args, options) { + var tr = this.tool(tool); + tr.on('debug', function (data) { + exports.debug(data); + }); + if (args) { + if (args instanceof Array) { + tr.arg(args); + } + else if (typeof (args) === 'string') { + tr.line(args); + } + } + return tr.exec(options); +} +exports.exec = exec; +/** + * Exec a tool synchronously. Convenience wrapper over ToolRunner to execSync with args in one call. + * Output will be *not* be streamed to the live console. It will be returned after execution is complete. + * Appropriate for short running tools + * Returns IExecResult with output and return code + * + * @param tool path to tool to exec + * @param args an arg string or array of args + * @param options optional exec options. See IExecSyncOptions + * @returns IExecSyncResult + */ +function execSync(tool, args, options) { + var tr = this.tool(tool); + tr.on('debug', function (data) { + exports.debug(data); + }); + if (args) { + if (args instanceof Array) { + tr.arg(args); + } + else if (typeof (args) === 'string') { + tr.line(args); + } + } + return tr.execSync(options); +} +exports.execSync = execSync; +/** + * Convenience factory to create a ToolRunner. + * + * @param tool path to tool to exec + * @returns ToolRunner + */ +function tool(tool) { + var tr = new trm.ToolRunner(tool); + tr.on('debug', function (message) { + exports.debug(message); + }); + return tr; +} +exports.tool = tool; +/** + * Applies glob patterns to a list of paths. Supports interleaved exclude patterns. + * + * @param list array of paths + * @param patterns patterns to apply. supports interleaved exclude patterns. + * @param patternRoot optional. default root to apply to unrooted patterns. not applied to basename-only patterns when matchBase:true. + * @param options optional. defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' }. + */ +function match(list, patterns, patternRoot, options) { + // trace parameters + exports.debug("patternRoot: '" + patternRoot + "'"); + options = options || _getDefaultMatchOptions(); // default match options + _debugMatchOptions(options); + // convert pattern to an array + if (typeof patterns == 'string') { + patterns = [patterns]; + } + // hashtable to keep track of matches + var map = {}; + var originalOptions = options; + for (var _i = 0, patterns_1 = patterns; _i < patterns_1.length; _i++) { + var pattern = patterns_1[_i]; + exports.debug("pattern: '" + pattern + "'"); + // trim and skip empty + pattern = (pattern || '').trim(); + if (!pattern) { + exports.debug('skipping empty pattern'); + continue; + } + // clone match options + var options_1 = im._cloneMatchOptions(originalOptions); + // skip comments + if (!options_1.nocomment && im._startsWith(pattern, '#')) { + exports.debug('skipping comment'); + continue; + } + // set nocomment - brace expansion could result in a leading '#' + options_1.nocomment = true; + // determine whether pattern is include or exclude + var negateCount = 0; + if (!options_1.nonegate) { + while (pattern.charAt(negateCount) == '!') { + negateCount++; + } + pattern = pattern.substring(negateCount); // trim leading '!' + if (negateCount) { + exports.debug("trimmed leading '!'. pattern: '" + pattern + "'"); + } + } + var isIncludePattern = negateCount == 0 || + (negateCount % 2 == 0 && !options_1.flipNegate) || + (negateCount % 2 == 1 && options_1.flipNegate); + // set nonegate - brace expansion could result in a leading '!' + options_1.nonegate = true; + options_1.flipNegate = false; + // expand braces - required to accurately root patterns + var expanded = void 0; + var preExpanded = pattern; + if (options_1.nobrace) { + expanded = [pattern]; + } + else { + // convert slashes on Windows before calling braceExpand(). unfortunately this means braces cannot + // be escaped on Windows, this limitation is consistent with current limitations of minimatch (3.0.3). + exports.debug('expanding braces'); + var convertedPattern = process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern; + expanded = minimatch.braceExpand(convertedPattern); + } + // set nobrace + options_1.nobrace = true; + for (var _a = 0, expanded_1 = expanded; _a < expanded_1.length; _a++) { + var pattern_1 = expanded_1[_a]; + if (expanded.length != 1 || pattern_1 != preExpanded) { + exports.debug("pattern: '" + pattern_1 + "'"); + } + // trim and skip empty + pattern_1 = (pattern_1 || '').trim(); + if (!pattern_1) { + exports.debug('skipping empty pattern'); + continue; + } + // root the pattern when all of the following conditions are true: + if (patternRoot && // patternRoot supplied + !im._isRooted(pattern_1) && // AND pattern not rooted + // AND matchBase:false or not basename only + (!options_1.matchBase || (process.platform == 'win32' ? pattern_1.replace(/\\/g, '/') : pattern_1).indexOf('/') >= 0)) { + pattern_1 = im._ensureRooted(patternRoot, pattern_1); + exports.debug("rooted pattern: '" + pattern_1 + "'"); + } + if (isIncludePattern) { + // apply the pattern + exports.debug('applying include pattern against original list'); + var matchResults = minimatch.match(list, pattern_1, options_1); + exports.debug(matchResults.length + ' matches'); + // union the results + for (var _b = 0, matchResults_1 = matchResults; _b < matchResults_1.length; _b++) { + var matchResult = matchResults_1[_b]; + map[matchResult] = true; + } + } + else { + // apply the pattern + exports.debug('applying exclude pattern against original list'); + var matchResults = minimatch.match(list, pattern_1, options_1); + exports.debug(matchResults.length + ' matches'); + // substract the results + for (var _c = 0, matchResults_2 = matchResults; _c < matchResults_2.length; _c++) { + var matchResult = matchResults_2[_c]; + delete map[matchResult]; + } + } + } + } + // return a filtered version of the original list (preserves order and prevents duplication) + var result = list.filter(function (item) { return map.hasOwnProperty(item); }); + exports.debug(result.length + ' final results'); + return result; +} +exports.match = match; +/** + * Filter to apply glob patterns + * + * @param pattern pattern to apply + * @param options optional. defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' }. + */ +function filter(pattern, options) { + options = options || _getDefaultMatchOptions(); + return minimatch.filter(pattern, options); +} +exports.filter = filter; +function _debugMatchOptions(options) { + exports.debug("matchOptions.debug: '" + options.debug + "'"); + exports.debug("matchOptions.nobrace: '" + options.nobrace + "'"); + exports.debug("matchOptions.noglobstar: '" + options.noglobstar + "'"); + exports.debug("matchOptions.dot: '" + options.dot + "'"); + exports.debug("matchOptions.noext: '" + options.noext + "'"); + exports.debug("matchOptions.nocase: '" + options.nocase + "'"); + exports.debug("matchOptions.nonull: '" + options.nonull + "'"); + exports.debug("matchOptions.matchBase: '" + options.matchBase + "'"); + exports.debug("matchOptions.nocomment: '" + options.nocomment + "'"); + exports.debug("matchOptions.nonegate: '" + options.nonegate + "'"); + exports.debug("matchOptions.flipNegate: '" + options.flipNegate + "'"); +} +function _getDefaultMatchOptions() { + return { + debug: false, + nobrace: true, + noglobstar: false, + dot: true, + noext: false, + nocase: process.platform == 'win32', + nonull: false, + matchBase: false, + nocomment: false, + nonegate: false, + flipNegate: false + }; +} +/** + * Determines the find root from a list of patterns. Performs the find and then applies the glob patterns. + * Supports interleaved exclude patterns. Unrooted patterns are rooted using defaultRoot, unless + * matchOptions.matchBase is specified and the pattern is a basename only. For matchBase cases, the + * defaultRoot is used as the find root. + * + * @param defaultRoot default path to root unrooted patterns. falls back to System.DefaultWorkingDirectory or process.cwd(). + * @param patterns pattern or array of patterns to apply + * @param findOptions defaults to { followSymbolicLinks: true }. following soft links is generally appropriate unless deleting files. + * @param matchOptions defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' } + */ +function findMatch(defaultRoot, patterns, findOptions, matchOptions) { + // apply defaults for parameters and trace + defaultRoot = defaultRoot || this.getVariable('system.defaultWorkingDirectory') || process.cwd(); + exports.debug("defaultRoot: '" + defaultRoot + "'"); + patterns = patterns || []; + patterns = typeof patterns == 'string' ? [patterns] : patterns; + findOptions = findOptions || _getDefaultFindOptions(); + _debugFindOptions(findOptions); + matchOptions = matchOptions || _getDefaultMatchOptions(); + _debugMatchOptions(matchOptions); + // normalize slashes for root dir + defaultRoot = im._normalizeSeparators(defaultRoot); + var results = {}; + var originalMatchOptions = matchOptions; + for (var _i = 0, _a = (patterns || []); _i < _a.length; _i++) { + var pattern = _a[_i]; + exports.debug("pattern: '" + pattern + "'"); + // trim and skip empty + pattern = (pattern || '').trim(); + if (!pattern) { + exports.debug('skipping empty pattern'); + continue; + } + // clone match options + var matchOptions_1 = im._cloneMatchOptions(originalMatchOptions); + // skip comments + if (!matchOptions_1.nocomment && im._startsWith(pattern, '#')) { + exports.debug('skipping comment'); + continue; + } + // set nocomment - brace expansion could result in a leading '#' + matchOptions_1.nocomment = true; + // determine whether pattern is include or exclude + var negateCount = 0; + if (!matchOptions_1.nonegate) { + while (pattern.charAt(negateCount) == '!') { + negateCount++; + } + pattern = pattern.substring(negateCount); // trim leading '!' + if (negateCount) { + exports.debug("trimmed leading '!'. pattern: '" + pattern + "'"); + } + } + var isIncludePattern = negateCount == 0 || + (negateCount % 2 == 0 && !matchOptions_1.flipNegate) || + (negateCount % 2 == 1 && matchOptions_1.flipNegate); + // set nonegate - brace expansion could result in a leading '!' + matchOptions_1.nonegate = true; + matchOptions_1.flipNegate = false; + // expand braces - required to accurately interpret findPath + var expanded = void 0; + var preExpanded = pattern; + if (matchOptions_1.nobrace) { + expanded = [pattern]; + } + else { + // convert slashes on Windows before calling braceExpand(). unfortunately this means braces cannot + // be escaped on Windows, this limitation is consistent with current limitations of minimatch (3.0.3). + exports.debug('expanding braces'); + var convertedPattern = process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern; + expanded = minimatch.braceExpand(convertedPattern); + } + // set nobrace + matchOptions_1.nobrace = true; + for (var _b = 0, expanded_2 = expanded; _b < expanded_2.length; _b++) { + var pattern_2 = expanded_2[_b]; + if (expanded.length != 1 || pattern_2 != preExpanded) { + exports.debug("pattern: '" + pattern_2 + "'"); + } + // trim and skip empty + pattern_2 = (pattern_2 || '').trim(); + if (!pattern_2) { + exports.debug('skipping empty pattern'); + continue; + } + if (isIncludePattern) { + // determine the findPath + var findInfo = im._getFindInfoFromPattern(defaultRoot, pattern_2, matchOptions_1); + var findPath = findInfo.findPath; + exports.debug("findPath: '" + findPath + "'"); + if (!findPath) { + exports.debug('skipping empty path'); + continue; + } + // perform the find + exports.debug("statOnly: '" + findInfo.statOnly + "'"); + var findResults = []; + if (findInfo.statOnly) { + // simply stat the path - all path segments were used to build the path + try { + fs.statSync(findPath); + findResults.push(findPath); + } + catch (err) { + if (err.code != 'ENOENT') { + throw err; + } + exports.debug('ENOENT'); + } + } + else { + findResults = find(findPath, findOptions); + } + exports.debug("found " + findResults.length + " paths"); + // apply the pattern + exports.debug('applying include pattern'); + if (findInfo.adjustedPattern != pattern_2) { + exports.debug("adjustedPattern: '" + findInfo.adjustedPattern + "'"); + pattern_2 = findInfo.adjustedPattern; + } + var matchResults = minimatch.match(findResults, pattern_2, matchOptions_1); + exports.debug(matchResults.length + ' matches'); + // union the results + for (var _c = 0, matchResults_3 = matchResults; _c < matchResults_3.length; _c++) { + var matchResult = matchResults_3[_c]; + var key = process.platform == 'win32' ? matchResult.toUpperCase() : matchResult; + results[key] = matchResult; + } + } + else { + // check if basename only and matchBase=true + if (matchOptions_1.matchBase && + !im._isRooted(pattern_2) && + (process.platform == 'win32' ? pattern_2.replace(/\\/g, '/') : pattern_2).indexOf('/') < 0) { + // do not root the pattern + exports.debug('matchBase and basename only'); + } + else { + // root the exclude pattern + pattern_2 = im._ensurePatternRooted(defaultRoot, pattern_2); + exports.debug("after ensurePatternRooted, pattern: '" + pattern_2 + "'"); + } + // apply the pattern + exports.debug('applying exclude pattern'); + var matchResults = minimatch.match(Object.keys(results).map(function (key) { return results[key]; }), pattern_2, matchOptions_1); + exports.debug(matchResults.length + ' matches'); + // substract the results + for (var _d = 0, matchResults_4 = matchResults; _d < matchResults_4.length; _d++) { + var matchResult = matchResults_4[_d]; + var key = process.platform == 'win32' ? matchResult.toUpperCase() : matchResult; + delete results[key]; + } + } + } + } + var finalResult = Object.keys(results) + .map(function (key) { return results[key]; }) + .sort(); + exports.debug(finalResult.length + ' final results'); + return finalResult; +} +exports.findMatch = findMatch; +/** + * Build Proxy URL in the following format: protocol://username:password@hostname:port + * @param proxyUrl Url address of the proxy server (eg: http://example.com) + * @param proxyUsername Proxy username (optional) + * @param proxyPassword Proxy password (optional) + * @returns string + */ +function getProxyFormattedUrl(proxyUrl, proxyUsername, proxyPassword) { + var parsedUrl = new URL(proxyUrl); + var proxyAddress = parsedUrl.protocol + "//" + parsedUrl.host; + if (proxyUsername) { + proxyAddress = parsedUrl.protocol + "//" + proxyUsername + ":" + proxyPassword + "@" + parsedUrl.host; + } + return proxyAddress; +} +/** + * Gets http proxy configuration used by Build/Release agent + * + * @return ProxyConfiguration + */ +function getHttpProxyConfiguration(requestUrl) { + var proxyUrl = exports.getVariable('Agent.ProxyUrl'); + if (proxyUrl && proxyUrl.length > 0) { + var proxyUsername = exports.getVariable('Agent.ProxyUsername'); + var proxyPassword = exports.getVariable('Agent.ProxyPassword'); + var proxyBypassHosts = JSON.parse(exports.getVariable('Agent.ProxyBypassList') || '[]'); + var bypass_1 = false; + if (requestUrl) { + proxyBypassHosts.forEach(function (bypassHost) { + if (new RegExp(bypassHost, 'i').test(requestUrl)) { + bypass_1 = true; + } + }); + } + if (bypass_1) { + return null; + } + else { + var proxyAddress = getProxyFormattedUrl(proxyUrl, proxyUsername, proxyPassword); + return { + proxyUrl: proxyUrl, + proxyUsername: proxyUsername, + proxyPassword: proxyPassword, + proxyBypassHosts: proxyBypassHosts, + proxyFormattedUrl: proxyAddress + }; + } + } + else { + return null; + } +} +exports.getHttpProxyConfiguration = getHttpProxyConfiguration; +/** + * Gets http certificate configuration used by Build/Release agent + * + * @return CertConfiguration + */ +function getHttpCertConfiguration() { + var ca = exports.getVariable('Agent.CAInfo'); + var clientCert = exports.getVariable('Agent.ClientCert'); + if (ca || clientCert) { + var certConfig = {}; + certConfig.caFile = ca; + certConfig.certFile = clientCert; + if (clientCert) { + var clientCertKey = exports.getVariable('Agent.ClientCertKey'); + var clientCertArchive = exports.getVariable('Agent.ClientCertArchive'); + var clientCertPassword = exports.getVariable('Agent.ClientCertPassword'); + certConfig.keyFile = clientCertKey; + certConfig.certArchiveFile = clientCertArchive; + certConfig.passphrase = clientCertPassword; + } + return certConfig; + } + else { + return null; + } +} +exports.getHttpCertConfiguration = getHttpCertConfiguration; +//----------------------------------------------------- +// Test Publisher +//----------------------------------------------------- +var TestPublisher = /** @class */ (function () { + function TestPublisher(testRunner) { + this.testRunner = testRunner; + } + TestPublisher.prototype.publish = function (resultFiles, mergeResults, platform, config, runTitle, publishRunAttachments, testRunSystem) { + // Could have used an initializer, but wanted to avoid reordering parameters when converting to strict null checks + // (A parameter cannot both be optional and have an initializer) + testRunSystem = testRunSystem || "VSTSTask"; + var properties = {}; + properties['type'] = this.testRunner; + if (mergeResults) { + properties['mergeResults'] = mergeResults; + } + if (platform) { + properties['platform'] = platform; + } + if (config) { + properties['config'] = config; + } + if (runTitle) { + properties['runTitle'] = runTitle; + } + if (publishRunAttachments) { + properties['publishRunAttachments'] = publishRunAttachments; + } + if (resultFiles) { + properties['resultFiles'] = Array.isArray(resultFiles) ? resultFiles.join() : resultFiles; + } + properties['testRunSystem'] = testRunSystem; + exports.command('results.publish', properties, ''); + }; + return TestPublisher; +}()); +exports.TestPublisher = TestPublisher; +//----------------------------------------------------- +// Code coverage Publisher +//----------------------------------------------------- +var CodeCoveragePublisher = /** @class */ (function () { + function CodeCoveragePublisher() { + } + CodeCoveragePublisher.prototype.publish = function (codeCoverageTool, summaryFileLocation, reportDirectory, additionalCodeCoverageFiles) { + var properties = {}; + if (codeCoverageTool) { + properties['codecoveragetool'] = codeCoverageTool; + } + if (summaryFileLocation) { + properties['summaryfile'] = summaryFileLocation; + } + if (reportDirectory) { + properties['reportdirectory'] = reportDirectory; + } + if (additionalCodeCoverageFiles) { + properties['additionalcodecoveragefiles'] = Array.isArray(additionalCodeCoverageFiles) ? additionalCodeCoverageFiles.join() : additionalCodeCoverageFiles; + } + exports.command('codecoverage.publish', properties, ""); + }; + return CodeCoveragePublisher; +}()); +exports.CodeCoveragePublisher = CodeCoveragePublisher; +//----------------------------------------------------- +// Code coverage Publisher +//----------------------------------------------------- +var CodeCoverageEnabler = /** @class */ (function () { + function CodeCoverageEnabler(buildTool, ccTool) { + this.buildTool = buildTool; + this.ccTool = ccTool; + } + CodeCoverageEnabler.prototype.enableCodeCoverage = function (buildProps) { + buildProps['buildtool'] = this.buildTool; + buildProps['codecoveragetool'] = this.ccTool; + exports.command('codecoverage.enable', buildProps, ""); + }; + return CodeCoverageEnabler; +}()); +exports.CodeCoverageEnabler = CodeCoverageEnabler; +//----------------------------------------------------- +// Task Logging Commands +//----------------------------------------------------- +/** + * Upload user interested file as additional log information + * to the current timeline record. + * + * The file shall be available for download along with task logs. + * + * @param path Path to the file that should be uploaded. + * @returns void + */ +function uploadFile(path) { + exports.command("task.uploadfile", null, path); +} +exports.uploadFile = uploadFile; +/** + * Instruction for the agent to update the PATH environment variable. + * The specified directory is prepended to the PATH. + * The updated environment variable will be reflected in subsequent tasks. + * + * @param path Local directory path. + * @returns void + */ +function prependPath(path) { + assertAgent("2.115.0"); + exports.command("task.prependpath", null, path); +} +exports.prependPath = prependPath; +/** + * Upload and attach summary markdown to current timeline record. + * This summary shall be added to the build/release summary and + * not available for download with logs. + * + * @param path Local directory path. + * @returns void + */ +function uploadSummary(path) { + exports.command("task.uploadsummary", null, path); +} +exports.uploadSummary = uploadSummary; +/** + * Upload and attach attachment to current timeline record. + * These files are not available for download with logs. + * These can only be referred to by extensions using the type or name values. + * + * @param type Attachment type. + * @param name Attachment name. + * @param path Attachment path. + * @returns void + */ +function addAttachment(type, name, path) { + exports.command("task.addattachment", { "type": type, "name": name }, path); +} +exports.addAttachment = addAttachment; +/** + * Set an endpoint field with given value. + * Value updated will be retained in the endpoint for + * the subsequent tasks that execute within the same job. + * + * @param id Endpoint id. + * @param field FieldType enum of AuthParameter, DataParameter or Url. + * @param key Key. + * @param value Value for key or url. + * @returns void + */ +function setEndpoint(id, field, key, value) { + exports.command("task.setendpoint", { "id": id, "field": FieldType[field].toLowerCase(), "key": key }, value); +} +exports.setEndpoint = setEndpoint; +/** + * Set progress and current operation for current task. + * + * @param percent Percentage of completion. + * @param currentOperation Current pperation. + * @returns void + */ +function setProgress(percent, currentOperation) { + exports.command("task.setprogress", { "value": "" + percent }, currentOperation); +} +exports.setProgress = setProgress; +/** + * Indicates whether to write the logging command directly to the host or to the output pipeline. + * + * @param id Timeline record Guid. + * @param parentId Parent timeline record Guid. + * @param recordType Record type. + * @param recordName Record name. + * @param order Order of timeline record. + * @param startTime Start time. + * @param finishTime End time. + * @param progress Percentage of completion. + * @param state TaskState enum of Unknown, Initialized, InProgress or Completed. + * @param result TaskResult enum of Succeeded, SucceededWithIssues, Failed, Cancelled or Skipped. + * @param message current operation + * @returns void + */ +function logDetail(id, message, parentId, recordType, recordName, order, startTime, finishTime, progress, state, result) { + var properties = { + "id": id, + "parentid": parentId, + "type": recordType, + "name": recordName, + "order": order ? order.toString() : undefined, + "starttime": startTime, + "finishtime": finishTime, + "progress": progress ? progress.toString() : undefined, + "state": state ? TaskState[state] : undefined, + "result": result ? TaskResult[result] : undefined + }; + exports.command("task.logdetail", properties, message); +} +exports.logDetail = logDetail; +/** + * Log error or warning issue to timeline record of current task. + * + * @param type IssueType enum of Error or Warning. + * @param sourcePath Source file location. + * @param lineNumber Line number. + * @param columnNumber Column number. + * @param code Error or warning code. + * @param message Error or warning message. + * @returns void + */ +function logIssue(type, message, sourcePath, lineNumber, columnNumber, errorCode) { + var properties = { + "type": IssueType[type].toLowerCase(), + "code": errorCode, + "sourcepath": sourcePath, + "linenumber": lineNumber ? lineNumber.toString() : undefined, + "columnnumber": columnNumber ? columnNumber.toString() : undefined, + }; + exports.command("task.logissue", properties, message); +} +exports.logIssue = logIssue; +//----------------------------------------------------- +// Artifact Logging Commands +//----------------------------------------------------- +/** + * Upload user interested file as additional log information + * to the current timeline record. + * + * The file shall be available for download along with task logs. + * + * @param containerFolder Folder that the file will upload to, folder will be created if needed. + * @param path Path to the file that should be uploaded. + * @param name Artifact name. + * @returns void + */ +function uploadArtifact(containerFolder, path, name) { + exports.command("artifact.upload", { "containerfolder": containerFolder, "artifactname": name }, path); +} +exports.uploadArtifact = uploadArtifact; +/** + * Create an artifact link, artifact location is required to be + * a file container path, VC path or UNC share path. + * + * The file shall be available for download along with task logs. + * + * @param name Artifact name. + * @param path Path to the file that should be associated. + * @param artifactType ArtifactType enum of Container, FilePath, VersionControl, GitRef or TfvcLabel. + * @returns void + */ +function associateArtifact(name, path, artifactType) { + exports.command("artifact.associate", { "type": ArtifactType[artifactType].toLowerCase(), "artifactname": name }, path); +} +exports.associateArtifact = associateArtifact; +//----------------------------------------------------- +// Build Logging Commands +//----------------------------------------------------- +/** + * Upload user interested log to build’s container “logs\tool” folder. + * + * @param path Path to the file that should be uploaded. + * @returns void + */ +function uploadBuildLog(path) { + exports.command("build.uploadlog", null, path); +} +exports.uploadBuildLog = uploadBuildLog; +/** + * Update build number for current build. + * + * @param value Value to be assigned as the build number. + * @returns void + */ +function updateBuildNumber(value) { + exports.command("build.updatebuildnumber", null, value); +} +exports.updateBuildNumber = updateBuildNumber; +/** + * Add a tag for current build. + * + * @param value Tag value. + * @returns void + */ +function addBuildTag(value) { + exports.command("build.addbuildtag", null, value); +} +exports.addBuildTag = addBuildTag; +//----------------------------------------------------- +// Release Logging Commands +//----------------------------------------------------- +/** + * Update release name for current release. + * + * @param value Value to be assigned as the release name. + * @returns void + */ +function updateReleaseName(name) { + assertAgent("2.132.0"); + exports.command("release.updatereleasename", null, name); +} +exports.updateReleaseName = updateReleaseName; +//----------------------------------------------------- +// Tools +//----------------------------------------------------- +exports.TaskCommand = tcm.TaskCommand; +exports.commandFromString = tcm.commandFromString; +exports.ToolRunner = trm.ToolRunner; +//----------------------------------------------------- +// Validation Checks +//----------------------------------------------------- +// async await needs generators in node 4.x+ +if (semver.lt(process.versions.node, '4.2.0')) { + exports.warning('Tasks require a new agent. Upgrade your agent or node to 4.2.0 or later'); +} +//------------------------------------------------------------------- +// Populate the vault with sensitive data. Inputs and Endpoints +//------------------------------------------------------------------- +// avoid loading twice (overwrites .taskkey) +if (!global['_vsts_task_lib_loaded']) { + im._loadData(); + im._exposeProxySettings(); + im._exposeCertSettings(); +} diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/taskcommand.d.ts b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/taskcommand.d.ts new file mode 100644 index 0000000..ffa150c --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/taskcommand.d.ts @@ -0,0 +1,10 @@ +export declare class TaskCommand { + constructor(command: any, properties: any, message: any); + command: string; + message: string; + properties: { + [key: string]: string; + }; + toString(): string; +} +export declare function commandFromString(commandLine: any): TaskCommand; diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/taskcommand.js b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/taskcommand.js new file mode 100644 index 0000000..ee477e8 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/taskcommand.js @@ -0,0 +1,103 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.commandFromString = exports.TaskCommand = void 0; +// +// Command Format: +// ##vso[artifact.command key=value;key=value]user message +// +// Examples: +// ##vso[task.progress value=58] +// ##vso[task.issue type=warning;]This is the user warning message +// +var CMD_PREFIX = '##vso['; +var TaskCommand = /** @class */ (function () { + function TaskCommand(command, properties, message) { + if (!command) { + command = 'missing.command'; + } + this.command = command; + this.properties = properties; + this.message = message; + } + TaskCommand.prototype.toString = function () { + var cmdStr = CMD_PREFIX + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += ' '; + for (var key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + var val = this.properties[key]; + if (val) { + // safely append the val - avoid blowing up when attempting to + // call .replace() if message is not a string for some reason + cmdStr += key + '=' + escape('' + (val || '')) + ';'; + } + } + } + } + cmdStr += ']'; + // safely append the message - avoid blowing up when attempting to + // call .replace() if message is not a string for some reason + var message = '' + (this.message || ''); + cmdStr += escapedata(message); + return cmdStr; + }; + return TaskCommand; +}()); +exports.TaskCommand = TaskCommand; +function commandFromString(commandLine) { + var preLen = CMD_PREFIX.length; + var lbPos = commandLine.indexOf('['); + var rbPos = commandLine.indexOf(']'); + if (lbPos == -1 || rbPos == -1 || rbPos - lbPos < 3) { + throw new Error('Invalid command brackets'); + } + var cmdInfo = commandLine.substring(lbPos + 1, rbPos); + var spaceIdx = cmdInfo.indexOf(' '); + var command = cmdInfo; + var properties = {}; + if (spaceIdx > 0) { + command = cmdInfo.trim().substring(0, spaceIdx); + var propSection = cmdInfo.trim().substring(spaceIdx + 1); + var propLines = propSection.split(';'); + propLines.forEach(function (propLine) { + propLine = propLine.trim(); + if (propLine.length > 0) { + var eqIndex = propLine.indexOf('='); + if (eqIndex == -1) { + throw new Error('Invalid property: ' + propLine); + } + var key = propLine.substring(0, eqIndex); + var val = propLine.substring(eqIndex + 1); + properties[key] = unescape(val); + } + }); + } + var msg = unescapedata(commandLine.substring(rbPos + 1)); + var cmd = new TaskCommand(command, properties, msg); + return cmd; +} +exports.commandFromString = commandFromString; +function escapedata(s) { + return s.replace(/%/g, '%AZP25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A'); +} +function unescapedata(s) { + return s.replace(/%0D/g, '\r') + .replace(/%0A/g, '\n') + .replace(/%AZP25/g, '%'); +} +function escape(s) { + return s.replace(/%/g, '%AZP25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A') + .replace(/]/g, '%5D') + .replace(/;/g, '%3B'); +} +function unescape(s) { + return s.replace(/%0D/g, '\r') + .replace(/%0A/g, '\n') + .replace(/%5D/g, ']') + .replace(/%3B/g, ';') + .replace(/%AZP25/g, '%'); +} diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/toolrunner.d.ts b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/toolrunner.d.ts new file mode 100644 index 0000000..463b5ee --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/toolrunner.d.ts @@ -0,0 +1,159 @@ +/// +import Q = require('q'); +import events = require('events'); +/** + * Interface for exec options + */ +export interface IExecOptions extends IExecSyncOptions { + /** optional. whether to fail if output to stderr. defaults to false */ + failOnStdErr?: boolean; + /** optional. defaults to failing on non zero. ignore will not fail leaving it up to the caller */ + ignoreReturnCode?: boolean; +} +/** + * Interface for execSync options + */ +export interface IExecSyncOptions { + /** optional working directory. defaults to current */ + cwd?: string; + /** optional envvar dictionary. defaults to current process's env */ + env?: { + [key: string]: string | undefined; + }; + /** optional. defaults to false */ + silent?: boolean; + /** Optional. Default is process.stdout. */ + outStream?: NodeJS.WritableStream; + /** Optional. Default is process.stderr. */ + errStream?: NodeJS.WritableStream; + /** optional. Whether to skip quoting/escaping arguments if needed. defaults to false. */ + windowsVerbatimArguments?: boolean; + /** optional. Run command inside of the shell. Defaults to false. */ + shell?: boolean; +} +/** + * Interface for exec results returned from synchronous exec functions + */ +export interface IExecSyncResult { + /** standard output */ + stdout: string; + /** error output */ + stderr: string; + /** return code */ + code: number; + /** Error on failure */ + error: Error; +} +export declare class ToolRunner extends events.EventEmitter { + constructor(toolPath: string); + private readonly cmdSpecialChars; + private toolPath; + private args; + private pipeOutputToTool; + private pipeOutputToFile; + private childProcess; + private _debug; + private _argStringToArray; + private _getCommandString; + private _processLineBuffer; + /** + * Wraps an arg string with specified char if it's not already wrapped + * @returns {string} Arg wrapped with specified char + * @param {string} arg Input argument string + * @param {string} wrapChar A char input string should be wrapped with + */ + private _wrapArg; + /** + * Unwraps an arg string wrapped with specified char + * @param arg Arg wrapped with specified char + * @param wrapChar A char to be removed + */ + private _unwrapArg; + /** + * Determine if arg string is wrapped with specified char + * @param arg Input arg string + */ + private _isWrapped; + private _getSpawnFileName; + private _getSpawnArgs; + /** + * Escape specified character. + * @param arg String to escape char in + * @param charToEscape Char should be escaped + */ + private _escapeChar; + private _isCmdFile; + /** + * Determine whether the cmd arg needs to be quoted. Returns true if arg contains any of special chars array. + * @param arg The cmd command arg. + * @param additionalChars Additional chars which should be also checked. + */ + private _needQuotesForCmd; + private _windowsQuoteCmdArg; + private _uv_quote_cmd_arg; + private _cloneExecOptions; + private _getSpawnOptions; + private _getSpawnSyncOptions; + private execWithPiping; + /** + * Add argument + * Append an argument or an array of arguments + * returns ToolRunner for chaining + * + * @param val string cmdline or array of strings + * @returns ToolRunner + */ + arg(val: string | string[]): ToolRunner; + /** + * Parses an argument line into one or more arguments + * e.g. .line('"arg one" two -z') is equivalent to .arg(['arg one', 'two', '-z']) + * returns ToolRunner for chaining + * + * @param val string argument line + * @returns ToolRunner + */ + line(val: string): ToolRunner; + /** + * Add argument(s) if a condition is met + * Wraps arg(). See arg for details + * returns ToolRunner for chaining + * + * @param condition boolean condition + * @param val string cmdline or array of strings + * @returns ToolRunner + */ + argIf(condition: any, val: any): this; + /** + * Pipe output of exec() to another tool + * @param tool + * @param file optional filename to additionally stream the output to. + * @returns {ToolRunner} + */ + pipeExecOutputToTool(tool: ToolRunner, file?: string): ToolRunner; + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See IExecOptions + * @returns number + */ + exec(options?: IExecOptions): Q.Promise; + /** + * Exec a tool synchronously. + * Output will be *not* be streamed to the live console. It will be returned after execution is complete. + * Appropriate for short running tools + * Returns IExecSyncResult with output and return code + * + * @param tool path to tool to exec + * @param options optional exec options. See IExecSyncOptions + * @returns IExecSyncResult + */ + execSync(options?: IExecSyncOptions): IExecSyncResult; + /** + * Used to close child process by sending SIGNINT signal. + * It allows executed script to have some additional logic on SIGINT, before exiting. + */ + killChildProcess(): void; +} diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/toolrunner.js b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/toolrunner.js new file mode 100644 index 0000000..d25bab2 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/toolrunner.js @@ -0,0 +1,968 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ToolRunner = void 0; +var Q = require("q"); +var os = require("os"); +var events = require("events"); +var child = require("child_process"); +var im = require("./internal"); +var fs = require("fs"); +var ToolRunner = /** @class */ (function (_super) { + __extends(ToolRunner, _super); + function ToolRunner(toolPath) { + var _this = _super.call(this) || this; + _this.cmdSpecialChars = [' ', '\t', '&', '(', ')', '[', ']', '{', '}', '^', '=', ';', '!', '\'', '+', ',', '`', '~', '|', '<', '>', '"']; + if (!toolPath) { + throw new Error('Parameter \'toolPath\' cannot be null or empty.'); + } + _this.toolPath = im._which(toolPath, true); + _this.args = []; + _this._debug('toolRunner toolPath: ' + toolPath); + return _this; + } + ToolRunner.prototype._debug = function (message) { + this.emit('debug', message); + }; + ToolRunner.prototype._argStringToArray = function (argString) { + var args = []; + var inQuotes = false; + var escaped = false; + var lastCharWasSpace = true; + var arg = ''; + var append = function (c) { + // we only escape double quotes. + if (escaped) { + if (c !== '"') { + arg += '\\'; + } + else { + arg.slice(0, -1); + } + } + arg += c; + escaped = false; + }; + for (var i = 0; i < argString.length; i++) { + var c = argString.charAt(i); + if (c === ' ' && !inQuotes) { + if (!lastCharWasSpace) { + args.push(arg); + arg = ''; + } + lastCharWasSpace = true; + continue; + } + else { + lastCharWasSpace = false; + } + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } + else { + append(c); + } + continue; + } + if (c === "\\" && escaped) { + append(c); + continue; + } + if (c === "\\" && inQuotes) { + escaped = true; + continue; + } + append(c); + lastCharWasSpace = false; + } + if (!lastCharWasSpace) { + args.push(arg.trim()); + } + return args; + }; + ToolRunner.prototype._getCommandString = function (options, noPrefix) { + var _this = this; + var toolPath = this._getSpawnFileName(); + var args = this._getSpawnArgs(options); + var cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool + var commandParts = []; + if (process.platform == 'win32') { + // Windows + cmd file + if (this._isCmdFile()) { + commandParts.push(toolPath); + commandParts = commandParts.concat(args); + } + // Windows + verbatim + else if (options.windowsVerbatimArguments) { + commandParts.push("\"" + toolPath + "\""); + commandParts = commandParts.concat(args); + } + else if (options.shell) { + commandParts.push(this._windowsQuoteCmdArg(toolPath)); + commandParts = commandParts.concat(args); + } + // Windows (regular) + else { + commandParts.push(this._windowsQuoteCmdArg(toolPath)); + commandParts = commandParts.concat(args.map(function (arg) { return _this._windowsQuoteCmdArg(arg); })); + } + } + else { + // OSX/Linux - this can likely be improved with some form of quoting. + // creating processes on Unix is fundamentally different than Windows. + // on Unix, execvp() takes an arg array. + commandParts.push(toolPath); + commandParts = commandParts.concat(args); + } + cmd += commandParts.join(' '); + // append second tool + if (this.pipeOutputToTool) { + cmd += ' | ' + this.pipeOutputToTool._getCommandString(options, /*noPrefix:*/ true); + } + return cmd; + }; + ToolRunner.prototype._processLineBuffer = function (data, strBuffer, onLine) { + try { + var s = strBuffer + data.toString(); + var n = s.indexOf(os.EOL); + while (n > -1) { + var line = s.substring(0, n); + onLine(line); + // the rest of the string ... + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); + } + strBuffer = s; + } + catch (err) { + // streaming lines to console is best effort. Don't fail a build. + this._debug('error processing line'); + } + }; + /** + * Wraps an arg string with specified char if it's not already wrapped + * @returns {string} Arg wrapped with specified char + * @param {string} arg Input argument string + * @param {string} wrapChar A char input string should be wrapped with + */ + ToolRunner.prototype._wrapArg = function (arg, wrapChar) { + if (!this._isWrapped(arg, wrapChar)) { + return "" + wrapChar + arg + wrapChar; + } + return arg; + }; + /** + * Unwraps an arg string wrapped with specified char + * @param arg Arg wrapped with specified char + * @param wrapChar A char to be removed + */ + ToolRunner.prototype._unwrapArg = function (arg, wrapChar) { + if (this._isWrapped(arg, wrapChar)) { + var pattern = new RegExp("(^\\\\?" + wrapChar + ")|(\\\\?" + wrapChar + "$)", 'g'); + return arg.trim().replace(pattern, ''); + } + return arg; + }; + /** + * Determine if arg string is wrapped with specified char + * @param arg Input arg string + */ + ToolRunner.prototype._isWrapped = function (arg, wrapChar) { + var pattern = new RegExp("^\\\\?" + wrapChar + ".+\\\\?" + wrapChar + "$"); + return pattern.test(arg.trim()); + }; + ToolRunner.prototype._getSpawnFileName = function (options) { + if (process.platform == 'win32') { + if (this._isCmdFile()) { + return process.env['COMSPEC'] || 'cmd.exe'; + } + } + if (options && options.shell) { + return this._wrapArg(this.toolPath, '"'); + } + return this.toolPath; + }; + ToolRunner.prototype._getSpawnArgs = function (options) { + var _this = this; + if (process.platform == 'win32') { + if (this._isCmdFile()) { + var argline = "/D /S /C \"" + this._windowsQuoteCmdArg(this.toolPath); + for (var i = 0; i < this.args.length; i++) { + argline += ' '; + argline += options.windowsVerbatimArguments ? this.args[i] : this._windowsQuoteCmdArg(this.args[i]); + } + argline += '"'; + return [argline]; + } + if (options.windowsVerbatimArguments) { + // note, in Node 6.x options.argv0 can be used instead of overriding args.slice and args.unshift. + // for more details, refer to https://github.com/nodejs/node/blob/v6.x/lib/child_process.js + var args_1 = this.args.slice(0); // copy the array + // override slice to prevent Node from creating a copy of the arg array. + // we need Node to use the "unshift" override below. + args_1.slice = function () { + if (arguments.length != 1 || arguments[0] != 0) { + throw new Error('Unexpected arguments passed to args.slice when windowsVerbatimArguments flag is set.'); + } + return args_1; + }; + // override unshift + // + // when using the windowsVerbatimArguments option, Node does not quote the tool path when building + // the cmdline parameter for the win32 function CreateProcess(). an unquoted space in the tool path + // causes problems for tools when attempting to parse their own command line args. tools typically + // assume their arguments begin after arg 0. + // + // by hijacking unshift, we can quote the tool path when it pushed onto the args array. Node builds + // the cmdline parameter from the args array. + // + // note, we can't simply pass a quoted tool path to Node for multiple reasons: + // 1) Node verifies the file exists (calls win32 function GetFileAttributesW) and the check returns + // false if the path is quoted. + // 2) Node passes the tool path as the application parameter to CreateProcess, which expects the + // path to be unquoted. + // + // also note, in addition to the tool path being embedded within the cmdline parameter, Node also + // passes the tool path to CreateProcess via the application parameter (optional parameter). when + // present, Windows uses the application parameter to determine which file to run, instead of + // interpreting the file from the cmdline parameter. + args_1.unshift = function () { + if (arguments.length != 1) { + throw new Error('Unexpected arguments passed to args.unshift when windowsVerbatimArguments flag is set.'); + } + return Array.prototype.unshift.call(args_1, "\"" + arguments[0] + "\""); // quote the file name + }; + return args_1; + } + else if (options.shell) { + var args = []; + for (var _i = 0, _a = this.args; _i < _a.length; _i++) { + var arg = _a[_i]; + if (this._needQuotesForCmd(arg, '%')) { + args.push(this._wrapArg(arg, '"')); + } + else { + args.push(arg); + } + } + return args; + } + } + else if (options.shell) { + return this.args.map(function (arg) { + if (_this._isWrapped(arg, "'")) { + return arg; + } + // remove wrapping double quotes to avoid escaping + arg = _this._unwrapArg(arg, '"'); + arg = _this._escapeChar(arg, '"'); + return _this._wrapArg(arg, '"'); + }); + } + return this.args; + }; + /** + * Escape specified character. + * @param arg String to escape char in + * @param charToEscape Char should be escaped + */ + ToolRunner.prototype._escapeChar = function (arg, charToEscape) { + var escChar = "\\"; + var output = ''; + var charIsEscaped = false; + for (var _i = 0, arg_1 = arg; _i < arg_1.length; _i++) { + var char = arg_1[_i]; + if (char === charToEscape && !charIsEscaped) { + output += escChar + char; + } + else { + output += char; + } + charIsEscaped = char === escChar && !charIsEscaped; + } + return output; + }; + ToolRunner.prototype._isCmdFile = function () { + var upperToolPath = this.toolPath.toUpperCase(); + return im._endsWith(upperToolPath, '.CMD') || im._endsWith(upperToolPath, '.BAT'); + }; + /** + * Determine whether the cmd arg needs to be quoted. Returns true if arg contains any of special chars array. + * @param arg The cmd command arg. + * @param additionalChars Additional chars which should be also checked. + */ + ToolRunner.prototype._needQuotesForCmd = function (arg, additionalChars) { + var specialChars = this.cmdSpecialChars; + if (additionalChars) { + specialChars = this.cmdSpecialChars.concat(additionalChars); + } + var _loop_1 = function (char) { + if (specialChars.some(function (x) { return x === char; })) { + return { value: true }; + } + }; + for (var _i = 0, arg_2 = arg; _i < arg_2.length; _i++) { + var char = arg_2[_i]; + var state_1 = _loop_1(char); + if (typeof state_1 === "object") + return state_1.value; + } + return false; + }; + ToolRunner.prototype._windowsQuoteCmdArg = function (arg) { + // for .exe, apply the normal quoting rules that libuv applies + if (!this._isCmdFile()) { + return this._uv_quote_cmd_arg(arg); + } + // otherwise apply quoting rules specific to the cmd.exe command line parser. + // the libuv rules are generic and are not designed specifically for cmd.exe + // command line parser. + // + // for a detailed description of the cmd.exe command line parser, refer to + // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 + // need quotes for empty arg + if (!arg) { + return '""'; + } + // determine whether the arg needs to be quoted + var needsQuotes = this._needQuotesForCmd(arg); + // short-circuit if quotes not needed + if (!needsQuotes) { + return arg; + } + // the following quoting rules are very similar to the rules that by libuv applies. + // + // 1) wrap the string in quotes + // + // 2) double-up quotes - i.e. " => "" + // + // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately + // doesn't work well with a cmd.exe command line. + // + // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. + // for example, the command line: + // foo.exe "myarg:""my val""" + // is parsed by a .NET console app into an arg array: + // [ "myarg:\"my val\"" ] + // which is the same end result when applying libuv quoting rules. although the actual + // command line from libuv quoting rules would look like: + // foo.exe "myarg:\"my val\"" + // + // 3) double-up slashes that preceed a quote, + // e.g. hello \world => "hello \world" + // hello\"world => "hello\\""world" + // hello\\"world => "hello\\\\""world" + // hello world\ => "hello world\\" + // + // technically this is not required for a cmd.exe command line, or the batch argument parser. + // the reasons for including this as a .cmd quoting rule are: + // + // a) this is optimized for the scenario where the argument is passed from the .cmd file to an + // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. + // + // b) it's what we've been doing previously (by deferring to node default behavior) and we + // haven't heard any complaints about that aspect. + // + // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be + // escaped when used on the command line directly - even though within a .cmd file % can be escaped + // by using %%. + // + // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts + // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. + // + // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would + // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the + // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args + // to an external program. + // + // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. + // % can be escaped within a .cmd file. + var reverse = '"'; + var quote_hit = true; + for (var i = arg.length; i > 0; i--) { // walk the string in reverse + reverse += arg[i - 1]; + if (quote_hit && arg[i - 1] == '\\') { + reverse += '\\'; // double the slash + } + else if (arg[i - 1] == '"') { + quote_hit = true; + reverse += '"'; // double the quote + } + else { + quote_hit = false; + } + } + reverse += '"'; + return reverse.split('').reverse().join(''); + }; + ToolRunner.prototype._uv_quote_cmd_arg = function (arg) { + // Tool runner wraps child_process.spawn() and needs to apply the same quoting as + // Node in certain cases where the undocumented spawn option windowsVerbatimArguments + // is used. + // + // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, + // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), + // pasting copyright notice from Node within this function: + // + // Copyright Joyent, Inc. and other Node contributors. All rights reserved. + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to + // deal in the Software without restriction, including without limitation the + // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + // sell copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + // IN THE SOFTWARE. + if (!arg) { + // Need double quotation for empty argument + return '""'; + } + if (arg.indexOf(' ') < 0 && arg.indexOf('\t') < 0 && arg.indexOf('"') < 0) { + // No quotation needed + return arg; + } + if (arg.indexOf('"') < 0 && arg.indexOf('\\') < 0) { + // No embedded double quotes or backslashes, so I can just wrap + // quote marks around the whole thing. + return "\"" + arg + "\""; + } + // Expected input/output: + // input : hello"world + // output: "hello\"world" + // input : hello""world + // output: "hello\"\"world" + // input : hello\world + // output: hello\world + // input : hello\\world + // output: hello\\world + // input : hello\"world + // output: "hello\\\"world" + // input : hello\\"world + // output: "hello\\\\\"world" + // input : hello world\ + // output: "hello world\\" - note the comment in libuv actually reads "hello world\" + // but it appears the comment is wrong, it should be "hello world\\" + var reverse = '"'; + var quote_hit = true; + for (var i = arg.length; i > 0; i--) { // walk the string in reverse + reverse += arg[i - 1]; + if (quote_hit && arg[i - 1] == '\\') { + reverse += '\\'; + } + else if (arg[i - 1] == '"') { + quote_hit = true; + reverse += '\\'; + } + else { + quote_hit = false; + } + } + reverse += '"'; + return reverse.split('').reverse().join(''); + }; + ToolRunner.prototype._cloneExecOptions = function (options) { + options = options || {}; + var result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + shell: options.shell || false + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + }; + ToolRunner.prototype._getSpawnOptions = function (options) { + options = options || {}; + var result = {}; + result.cwd = options.cwd; + result.env = options.env; + result.shell = options.shell; + result['windowsVerbatimArguments'] = options.windowsVerbatimArguments || this._isCmdFile(); + return result; + }; + ToolRunner.prototype._getSpawnSyncOptions = function (options) { + var result = {}; + result.maxBuffer = 1024 * 1024 * 1024; + result.cwd = options.cwd; + result.env = options.env; + result.shell = options.shell; + result['windowsVerbatimArguments'] = options.windowsVerbatimArguments || this._isCmdFile(); + return result; + }; + ToolRunner.prototype.execWithPiping = function (pipeOutputToTool, options) { + var _this = this; + var _a, _b, _c, _d; + var defer = Q.defer(); + this._debug('exec tool: ' + this.toolPath); + this._debug('arguments:'); + this.args.forEach(function (arg) { + _this._debug(' ' + arg); + }); + var success = true; + var optionsNonNull = this._cloneExecOptions(options); + if (!optionsNonNull.silent) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + } + var cp; + var toolPath = pipeOutputToTool.toolPath; + var toolPathFirst; + var successFirst = true; + var returnCodeFirst; + var fileStream; + var waitingEvents = 0; // number of process or stream events we are waiting on to complete + var returnCode = 0; + var error; + toolPathFirst = this.toolPath; + // Following node documentation example from this link on how to pipe output of one process to another + // https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options + //start the child process for both tools + waitingEvents++; + var cpFirst = child.spawn(this._getSpawnFileName(optionsNonNull), this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(optionsNonNull)); + waitingEvents++; + cp = child.spawn(pipeOutputToTool._getSpawnFileName(optionsNonNull), pipeOutputToTool._getSpawnArgs(optionsNonNull), pipeOutputToTool._getSpawnOptions(optionsNonNull)); + fileStream = this.pipeOutputToFile ? fs.createWriteStream(this.pipeOutputToFile) : null; + if (fileStream) { + waitingEvents++; + fileStream.on('finish', function () { + waitingEvents--; //file write is complete + fileStream = null; + if (waitingEvents == 0) { + if (error) { + defer.reject(error); + } + else { + defer.resolve(returnCode); + } + } + }); + fileStream.on('error', function (err) { + waitingEvents--; //there were errors writing to the file, write is done + _this._debug("Failed to pipe output of " + toolPathFirst + " to file " + _this.pipeOutputToFile + ". Error = " + err); + fileStream = null; + if (waitingEvents == 0) { + if (error) { + defer.reject(error); + } + else { + defer.resolve(returnCode); + } + } + }); + } + //pipe stdout of first tool to stdin of second tool + (_a = cpFirst.stdout) === null || _a === void 0 ? void 0 : _a.on('data', function (data) { + var _a; + try { + if (fileStream) { + fileStream.write(data); + } + (_a = cp.stdin) === null || _a === void 0 ? void 0 : _a.write(data); + } + catch (err) { + _this._debug('Failed to pipe output of ' + toolPathFirst + ' to ' + toolPath); + _this._debug(toolPath + ' might have exited due to errors prematurely. Verify the arguments passed are valid.'); + } + }); + (_b = cpFirst.stderr) === null || _b === void 0 ? void 0 : _b.on('data', function (data) { + if (fileStream) { + fileStream.write(data); + } + successFirst = !optionsNonNull.failOnStdErr; + if (!optionsNonNull.silent) { + var s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; + s.write(data); + } + }); + cpFirst.on('error', function (err) { + var _a; + waitingEvents--; //first process is complete with errors + if (fileStream) { + fileStream.end(); + } + (_a = cp.stdin) === null || _a === void 0 ? void 0 : _a.end(); + error = new Error(toolPathFirst + ' failed. ' + err.message); + if (waitingEvents == 0) { + defer.reject(error); + } + }); + cpFirst.on('close', function (code, signal) { + var _a; + waitingEvents--; //first process is complete + if (code != 0 && !optionsNonNull.ignoreReturnCode) { + successFirst = false; + returnCodeFirst = code; + returnCode = returnCodeFirst; + } + _this._debug('success of first tool:' + successFirst); + if (fileStream) { + fileStream.end(); + } + (_a = cp.stdin) === null || _a === void 0 ? void 0 : _a.end(); + if (waitingEvents == 0) { + if (error) { + defer.reject(error); + } + else { + defer.resolve(returnCode); + } + } + }); + var stdbuffer = ''; + (_c = cp.stdout) === null || _c === void 0 ? void 0 : _c.on('data', function (data) { + _this.emit('stdout', data); + if (!optionsNonNull.silent) { + optionsNonNull.outStream.write(data); + } + _this._processLineBuffer(data, stdbuffer, function (line) { + _this.emit('stdline', line); + }); + }); + var errbuffer = ''; + (_d = cp.stderr) === null || _d === void 0 ? void 0 : _d.on('data', function (data) { + _this.emit('stderr', data); + success = !optionsNonNull.failOnStdErr; + if (!optionsNonNull.silent) { + var s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; + s.write(data); + } + _this._processLineBuffer(data, errbuffer, function (line) { + _this.emit('errline', line); + }); + }); + cp.on('error', function (err) { + waitingEvents--; //process is done with errors + error = new Error(toolPath + ' failed. ' + err.message); + if (waitingEvents == 0) { + defer.reject(error); + } + }); + cp.on('close', function (code, signal) { + waitingEvents--; //process is complete + _this._debug('rc:' + code); + returnCode = code; + if (stdbuffer.length > 0) { + _this.emit('stdline', stdbuffer); + } + if (errbuffer.length > 0) { + _this.emit('errline', errbuffer); + } + if (code != 0 && !optionsNonNull.ignoreReturnCode) { + success = false; + } + _this._debug('success:' + success); + if (!successFirst) { //in the case output is piped to another tool, check exit code of both tools + error = new Error(toolPathFirst + ' failed with return code: ' + returnCodeFirst); + } + else if (!success) { + error = new Error(toolPath + ' failed with return code: ' + code); + } + if (waitingEvents == 0) { + if (error) { + defer.reject(error); + } + else { + defer.resolve(returnCode); + } + } + }); + return defer.promise; + }; + /** + * Add argument + * Append an argument or an array of arguments + * returns ToolRunner for chaining + * + * @param val string cmdline or array of strings + * @returns ToolRunner + */ + ToolRunner.prototype.arg = function (val) { + if (!val) { + return this; + } + if (val instanceof Array) { + this._debug(this.toolPath + ' arg: ' + JSON.stringify(val)); + this.args = this.args.concat(val); + } + else if (typeof (val) === 'string') { + this._debug(this.toolPath + ' arg: ' + val); + this.args = this.args.concat(val.trim()); + } + return this; + }; + /** + * Parses an argument line into one or more arguments + * e.g. .line('"arg one" two -z') is equivalent to .arg(['arg one', 'two', '-z']) + * returns ToolRunner for chaining + * + * @param val string argument line + * @returns ToolRunner + */ + ToolRunner.prototype.line = function (val) { + if (!val) { + return this; + } + this._debug(this.toolPath + ' arg: ' + val); + this.args = this.args.concat(this._argStringToArray(val)); + return this; + }; + /** + * Add argument(s) if a condition is met + * Wraps arg(). See arg for details + * returns ToolRunner for chaining + * + * @param condition boolean condition + * @param val string cmdline or array of strings + * @returns ToolRunner + */ + ToolRunner.prototype.argIf = function (condition, val) { + if (condition) { + this.arg(val); + } + return this; + }; + /** + * Pipe output of exec() to another tool + * @param tool + * @param file optional filename to additionally stream the output to. + * @returns {ToolRunner} + */ + ToolRunner.prototype.pipeExecOutputToTool = function (tool, file) { + this.pipeOutputToTool = tool; + this.pipeOutputToFile = file; + return this; + }; + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See IExecOptions + * @returns number + */ + ToolRunner.prototype.exec = function (options) { + var _this = this; + var _a, _b, _c; + if (this.pipeOutputToTool) { + return this.execWithPiping(this.pipeOutputToTool, options); + } + var defer = Q.defer(); + this._debug('exec tool: ' + this.toolPath); + this._debug('arguments:'); + this.args.forEach(function (arg) { + _this._debug(' ' + arg); + }); + var optionsNonNull = this._cloneExecOptions(options); + if (!optionsNonNull.silent) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + } + var state = new ExecState(optionsNonNull, this.toolPath); + state.on('debug', function (message) { + _this._debug(message); + }); + var cp = child.spawn(this._getSpawnFileName(options), this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(options)); + this.childProcess = cp; + // it is possible for the child process to end its last line without a new line. + // because stdout is buffered, this causes the last line to not get sent to the parent + // stream. Adding this event forces a flush before the child streams are closed. + (_a = cp.stdout) === null || _a === void 0 ? void 0 : _a.on('finish', function () { + if (!optionsNonNull.silent) { + optionsNonNull.outStream.write(os.EOL); + } + }); + var stdbuffer = ''; + (_b = cp.stdout) === null || _b === void 0 ? void 0 : _b.on('data', function (data) { + _this.emit('stdout', data); + if (!optionsNonNull.silent) { + optionsNonNull.outStream.write(data); + } + _this._processLineBuffer(data, stdbuffer, function (line) { + _this.emit('stdline', line); + }); + }); + var errbuffer = ''; + (_c = cp.stderr) === null || _c === void 0 ? void 0 : _c.on('data', function (data) { + state.processStderr = true; + _this.emit('stderr', data); + if (!optionsNonNull.silent) { + var s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; + s.write(data); + } + _this._processLineBuffer(data, errbuffer, function (line) { + _this.emit('errline', line); + }); + }); + cp.on('error', function (err) { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on('exit', function (code, signal) { + state.processExitCode = code; + state.processExited = true; + _this._debug("Exit code " + code + " received from tool '" + _this.toolPath + "'"); + state.CheckComplete(); + }); + cp.on('close', function (code, signal) { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + _this._debug("STDIO streams have closed for tool '" + _this.toolPath + "'"); + state.CheckComplete(); + }); + state.on('done', function (error, exitCode) { + if (stdbuffer.length > 0) { + _this.emit('stdline', stdbuffer); + } + if (errbuffer.length > 0) { + _this.emit('errline', errbuffer); + } + cp.removeAllListeners(); + if (error) { + defer.reject(error); + } + else { + defer.resolve(exitCode); + } + }); + return defer.promise; + }; + /** + * Exec a tool synchronously. + * Output will be *not* be streamed to the live console. It will be returned after execution is complete. + * Appropriate for short running tools + * Returns IExecSyncResult with output and return code + * + * @param tool path to tool to exec + * @param options optional exec options. See IExecSyncOptions + * @returns IExecSyncResult + */ + ToolRunner.prototype.execSync = function (options) { + var _this = this; + this._debug('exec tool: ' + this.toolPath); + this._debug('arguments:'); + this.args.forEach(function (arg) { + _this._debug(' ' + arg); + }); + var success = true; + options = this._cloneExecOptions(options); + if (!options.silent) { + options.outStream.write(this._getCommandString(options) + os.EOL); + } + var r = child.spawnSync(this._getSpawnFileName(options), this._getSpawnArgs(options), this._getSpawnSyncOptions(options)); + if (!options.silent && r.stdout && r.stdout.length > 0) { + options.outStream.write(r.stdout); + } + if (!options.silent && r.stderr && r.stderr.length > 0) { + options.errStream.write(r.stderr); + } + var res = { code: r.status, error: r.error }; + res.stdout = (r.stdout) ? r.stdout.toString() : ''; + res.stderr = (r.stderr) ? r.stderr.toString() : ''; + return res; + }; + /** + * Used to close child process by sending SIGNINT signal. + * It allows executed script to have some additional logic on SIGINT, before exiting. + */ + ToolRunner.prototype.killChildProcess = function () { + if (this.childProcess) { + this.childProcess.kill(); + } + }; + return ToolRunner; +}(events.EventEmitter)); +exports.ToolRunner = ToolRunner; +var ExecState = /** @class */ (function (_super) { + __extends(ExecState, _super); + function ExecState(options, toolPath) { + var _this = _super.call(this) || this; + _this.delay = 10000; // 10 seconds + _this.timeout = null; + if (!toolPath) { + throw new Error('toolPath must not be empty'); + } + _this.options = options; + _this.toolPath = toolPath; + var delay = process.env['TASKLIB_TEST_TOOLRUNNER_EXITDELAY']; + if (delay) { + _this.delay = parseInt(delay); + } + return _this; + } + ExecState.prototype.CheckComplete = function () { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } + else if (this.processExited) { + this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this); + } + }; + ExecState.prototype._debug = function (message) { + this.emit('debug', message); + }; + ExecState.prototype._setResult = function () { + // determine whether there is an error + var error; + if (this.processExited) { + if (this.processError) { + error = new Error(im._loc('LIB_ProcessError', this.toolPath, this.processError)); + } + else if (this.processExitCode != 0 && !this.options.ignoreReturnCode) { + error = new Error(im._loc('LIB_ProcessExitCode', this.toolPath, this.processExitCode)); + } + else if (this.processStderr && this.options.failOnStdErr) { + error = new Error(im._loc('LIB_ProcessStderr', this.toolPath)); + } + } + // clear the timeout + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit('done', error, this.processExitCode); + }; + ExecState.HandleTimeout = function (state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + console.log(im._loc('LIB_StdioNotClosed', state.delay / 1000, state.toolPath)); + state._debug(im._loc('LIB_StdioNotClosed', state.delay / 1000, state.toolPath)); + } + state._setResult(); + }; + return ExecState; +}(events.EventEmitter)); diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/vault.d.ts b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/vault.d.ts new file mode 100644 index 0000000..4cfaefa --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/vault.d.ts @@ -0,0 +1,10 @@ +export declare class Vault { + constructor(keyPath: string); + private _keyFile; + private _store; + initialize(): void; + storeSecret(name: string, data: string): boolean; + retrieveSecret(name: string): string | undefined; + private getKey; + private genKey; +} diff --git a/Utilites/Shell++/node_modules/azure-pipelines-task-lib/vault.js b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/vault.js new file mode 100644 index 0000000..e656f66 --- /dev/null +++ b/Utilites/Shell++/node_modules/azure-pipelines-task-lib/vault.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Vault = void 0; +var fs = require("fs"); +var path = require("path"); +var crypto = require("crypto"); +var uuidV4 = require('uuid/v4'); +var algorithm = "aes-256-ctr"; +var encryptEncoding = 'hex'; +var unencryptedEncoding = 'utf8'; +// +// Store sensitive data in proc. +// Main goal: Protects tasks which would dump envvars from leaking secrets inadvertently +// the task lib clears after storing. +// Also protects against a dump of a process getting the secrets +// The secret is generated and stored externally for the lifetime of the task. +// +var Vault = /** @class */ (function () { + function Vault(keyPath) { + this._keyFile = path.join(keyPath, '.taskkey'); + this._store = {}; + this.genKey(); + } + Vault.prototype.initialize = function () { + }; + Vault.prototype.storeSecret = function (name, data) { + if (!name || name.length == 0) { + return false; + } + name = name.toLowerCase(); + if (!data || data.length == 0) { + if (this._store.hasOwnProperty(name)) { + delete this._store[name]; + } + return false; + } + var key = this.getKey(); + var iv = crypto.randomBytes(16); + var cipher = crypto.createCipheriv(algorithm, key, iv); + var crypted = cipher.update(data, unencryptedEncoding, encryptEncoding); + var cryptedFinal = cipher.final(encryptEncoding); + this._store[name] = iv.toString(encryptEncoding) + crypted + cryptedFinal; + return true; + }; + Vault.prototype.retrieveSecret = function (name) { + var secret; + name = (name || '').toLowerCase(); + if (this._store.hasOwnProperty(name)) { + var key = this.getKey(); + var data = this._store[name]; + var ivDataBuffer = Buffer.from(data, encryptEncoding); + var iv = ivDataBuffer.slice(0, 16); + var encryptedText = ivDataBuffer.slice(16); + var decipher = crypto.createDecipheriv(algorithm, key, iv); + var dec = decipher.update(encryptedText); + var decFinal = decipher.final(unencryptedEncoding); + secret = dec + decFinal; + } + return secret; + }; + Vault.prototype.getKey = function () { + var key = fs.readFileSync(this._keyFile).toString('utf8'); + // Key needs to be hashed to correct length to match algorithm (aes-256-ctr) + return crypto.createHash('sha256').update(key).digest(); + }; + Vault.prototype.genKey = function () { + fs.writeFileSync(this._keyFile, uuidV4(), { encoding: 'utf8' }); + }; + return Vault; +}()); +exports.Vault = Vault; diff --git a/Utilites/Shell++/task.js b/Utilites/Shell++/task.js index 8fc9232..8f212f4 100644 --- a/Utilites/Shell++/task.js +++ b/Utilites/Shell++/task.js @@ -1,5 +1,5 @@ var path = require('path'); -var tl = require('vso-task-lib'); +var tl = require('azue-pipelines-task-lib'); var fs = require('fs'); var echo = new tl.ToolRunner(tl.which('echo', true)); diff --git a/Utilites/Shell++/task.json b/Utilites/Shell++/task.json index bfe0c5d..d483ace 100644 --- a/Utilites/Shell++/task.json +++ b/Utilites/Shell++/task.json @@ -18,7 +18,7 @@ "Minor": "3", "Patch": "1" }, - "minimumAgentVersion": "1.83.0", + "minimumAgentVersion": "2.144.0", "instanceNameFormat": "Shell Script", "groups": [ { @@ -94,6 +94,14 @@ "Node": { "target": "task.js", "argumentFormat": "" + }, + "Node10": { + "target": "task.js", + "argumentFormat": "" + }, + "Node16": { + "target": "task.js", + "argumentFormat": "" } } }