summaryrefslogtreecommitdiffstatshomepage
path: root/node_modules/@actions/core/lib/command.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@actions/core/lib/command.js')
-rw-r--r--node_modules/@actions/core/lib/command.js49
1 files changed, 6 insertions, 43 deletions
diff --git a/node_modules/@actions/core/lib/command.js b/node_modules/@actions/core/lib/command.js
index b2a8c69..3d314fe 100644
--- a/node_modules/@actions/core/lib/command.js
+++ b/node_modules/@actions/core/lib/command.js
@@ -1,42 +1,5 @@
-"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;
- };
-})();
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.issueCommand = issueCommand;
-exports.issue = issue;
-const os = __importStar(require("os"));
-const utils_1 = require("./utils");
+import * as os from 'os';
+import { toCommandValue } from './utils.js';
/**
* Issues a command to the GitHub Actions runner
*
@@ -70,11 +33,11 @@ const utils_1 = require("./utils");
* This is an internal utility function that powers the public API functions
* such as setSecret, warning, error, and exportVariable.
*/
-function issueCommand(command, properties, message) {
+export function issueCommand(command, properties, message) {
const cmd = new Command(command, properties, message);
process.stdout.write(cmd.toString() + os.EOL);
}
-function issue(name, message = '') {
+export function issue(name, message = '') {
issueCommand(name, {}, message);
}
const CMD_STRING = '::';
@@ -112,13 +75,13 @@ class Command {
}
}
function escapeData(s) {
- return (0, utils_1.toCommandValue)(s)
+ return toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A');
}
function escapeProperty(s) {
- return (0, utils_1.toCommandValue)(s)
+ return toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A')