summaryrefslogtreecommitdiffstatshomepage
path: root/node_modules/@actions/exec/lib/exec.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@actions/exec/lib/exec.js')
-rw-r--r--node_modules/@actions/exec/lib/exec.js49
1 files changed, 6 insertions, 43 deletions
diff --git a/node_modules/@actions/exec/lib/exec.js b/node_modules/@actions/exec/lib/exec.js
index 524a59c..98fe217 100644
--- a/node_modules/@actions/exec/lib/exec.js
+++ b/node_modules/@actions/exec/lib/exec.js
@@ -1,37 +1,3 @@
-"use strict";
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}));
-var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
- o["default"] = v;
-});
-var __importStar = (this && this.__importStar) || (function () {
- var ownKeys = function(o) {
- ownKeys = Object.getOwnPropertyNames || function (o) {
- var ar = [];
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
- return ar;
- };
- return ownKeys(o);
- };
- return function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
- __setModuleDefault(result, mod);
- return result;
- };
-})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
@@ -41,11 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.exec = exec;
-exports.getExecOutput = getExecOutput;
-const string_decoder_1 = require("string_decoder");
-const tr = __importStar(require("./toolrunner"));
+import { StringDecoder } from 'string_decoder';
+import * as tr from './toolrunner.js';
/**
* Exec a command.
* Output will be streamed to the live console.
@@ -56,7 +19,7 @@ const tr = __importStar(require("./toolrunner"));
* @param options optional exec options. See ExecOptions
* @returns Promise<number> exit code
*/
-function exec(commandLine, args, options) {
+export function exec(commandLine, args, options) {
return __awaiter(this, void 0, void 0, function* () {
const commandArgs = tr.argStringToArray(commandLine);
if (commandArgs.length === 0) {
@@ -79,14 +42,14 @@ function exec(commandLine, args, options) {
* @param options optional exec options. See ExecOptions
* @returns Promise<ExecOutput> exit code, stdout, and stderr
*/
-function getExecOutput(commandLine, args, options) {
+export function getExecOutput(commandLine, args, options) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b;
let stdout = '';
let stderr = '';
//Using string decoder covers the case where a mult-byte character is split
- const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
- const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
+ const stdoutDecoder = new StringDecoder('utf8');
+ const stderrDecoder = new StringDecoder('utf8');
const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
const stdErrListener = (data) => {