mirror of
				https://github.com/gradle/gradle-build-action.git
				synced 2025-11-04 09:58:56 +08:00 
			
		
		
		
	Build outputs
This commit is contained in:
		
							
								
								
									
										265
									
								
								dist/post/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										265
									
								
								dist/post/index.js
									
									
									
									
										vendored
									
									
								
							@@ -62662,12 +62662,11 @@ const core = __importStar(__nccwpck_require__(2186));
 | 
			
		||||
const exec = __importStar(__nccwpck_require__(1514));
 | 
			
		||||
const path_1 = __importDefault(__nccwpck_require__(1017));
 | 
			
		||||
const fs_1 = __importDefault(__nccwpck_require__(7147));
 | 
			
		||||
const params = __importStar(__nccwpck_require__(3885));
 | 
			
		||||
const cache_utils_1 = __nccwpck_require__(1678);
 | 
			
		||||
const cache_extract_entries_1 = __nccwpck_require__(6161);
 | 
			
		||||
const RESTORED_CACHE_KEY_KEY = 'restored-cache-key';
 | 
			
		||||
exports.META_FILE_DIR = '.gradle-build-action';
 | 
			
		||||
const INCLUDE_PATHS_PARAMETER = 'gradle-home-cache-includes';
 | 
			
		||||
const EXCLUDE_PATHS_PARAMETER = 'gradle-home-cache-excludes';
 | 
			
		||||
class GradleStateCache {
 | 
			
		||||
    constructor(gradleUserHome) {
 | 
			
		||||
        this.gradleUserHome = gradleUserHome;
 | 
			
		||||
@@ -62759,7 +62758,7 @@ class GradleStateCache {
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    deleteExcludedPaths() {
 | 
			
		||||
        const rawPaths = core.getMultilineInput(EXCLUDE_PATHS_PARAMETER);
 | 
			
		||||
        const rawPaths = params.getCacheExcludes();
 | 
			
		||||
        const resolvedPaths = rawPaths.map(x => path_1.default.resolve(this.gradleUserHome, x));
 | 
			
		||||
        for (const p of resolvedPaths) {
 | 
			
		||||
            (0, cache_utils_1.cacheDebug)(`Deleting excluded path: ${p}`);
 | 
			
		||||
@@ -62767,7 +62766,7 @@ class GradleStateCache {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    getCachePath() {
 | 
			
		||||
        const rawPaths = core.getMultilineInput(INCLUDE_PATHS_PARAMETER);
 | 
			
		||||
        const rawPaths = params.getCacheIncludes();
 | 
			
		||||
        rawPaths.push(exports.META_FILE_DIR);
 | 
			
		||||
        const resolvedPaths = rawPaths.map(x => this.resolveCachePath(x));
 | 
			
		||||
        (0, cache_utils_1.cacheDebug)(`Using cache paths: ${resolvedPaths}`);
 | 
			
		||||
@@ -62995,6 +62994,7 @@ const path_1 = __importDefault(__nccwpck_require__(1017));
 | 
			
		||||
const fs_1 = __importDefault(__nccwpck_require__(7147));
 | 
			
		||||
const core = __importStar(__nccwpck_require__(2186));
 | 
			
		||||
const glob = __importStar(__nccwpck_require__(8090));
 | 
			
		||||
const params = __importStar(__nccwpck_require__(3885));
 | 
			
		||||
const cache_base_1 = __nccwpck_require__(6948);
 | 
			
		||||
const cache_utils_1 = __nccwpck_require__(1678);
 | 
			
		||||
const build_results_1 = __nccwpck_require__(2107);
 | 
			
		||||
@@ -63127,7 +63127,7 @@ class AbstractEntryExtractor {
 | 
			
		||||
    }
 | 
			
		||||
    awaitForDebugging(p) {
 | 
			
		||||
        return __awaiter(this, void 0, void 0, function* () {
 | 
			
		||||
            if ((0, cache_utils_1.isCacheDebuggingEnabled)()) {
 | 
			
		||||
            if (params.isCacheDebuggingEnabled()) {
 | 
			
		||||
                yield p;
 | 
			
		||||
            }
 | 
			
		||||
            return p;
 | 
			
		||||
@@ -63498,14 +63498,8 @@ const exec = __importStar(__nccwpck_require__(1514));
 | 
			
		||||
const crypto = __importStar(__nccwpck_require__(6113));
 | 
			
		||||
const path = __importStar(__nccwpck_require__(1017));
 | 
			
		||||
const fs = __importStar(__nccwpck_require__(7147));
 | 
			
		||||
const params = __importStar(__nccwpck_require__(3885));
 | 
			
		||||
const CACHE_PROTOCOL_VERSION = 'v8-';
 | 
			
		||||
const JOB_CONTEXT_PARAMETER = 'workflow-job-context';
 | 
			
		||||
const CACHE_DISABLED_PARAMETER = 'cache-disabled';
 | 
			
		||||
const CACHE_READONLY_PARAMETER = 'cache-read-only';
 | 
			
		||||
const CACHE_WRITEONLY_PARAMETER = 'cache-write-only';
 | 
			
		||||
const STRICT_CACHE_MATCH_PARAMETER = 'gradle-home-cache-strict-match';
 | 
			
		||||
const CACHE_CLEANUP_ENABLED_PARAMETER = 'gradle-home-cache-cleanup';
 | 
			
		||||
const CACHE_DEBUG_VAR = 'GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED';
 | 
			
		||||
const CACHE_KEY_PREFIX_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX';
 | 
			
		||||
const CACHE_KEY_OS_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_ENVIRONMENT';
 | 
			
		||||
const CACHE_KEY_JOB_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_JOB';
 | 
			
		||||
@@ -63517,23 +63511,23 @@ function isCacheDisabled() {
 | 
			
		||||
    if (!cache.isFeatureAvailable()) {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    return core.getBooleanInput(CACHE_DISABLED_PARAMETER);
 | 
			
		||||
    return params.isCacheDisabled();
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheDisabled = isCacheDisabled;
 | 
			
		||||
function isCacheReadOnly() {
 | 
			
		||||
    return !isCacheWriteOnly() && core.getBooleanInput(CACHE_READONLY_PARAMETER);
 | 
			
		||||
    return !isCacheWriteOnly() && params.isCacheReadOnly();
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheReadOnly = isCacheReadOnly;
 | 
			
		||||
function isCacheWriteOnly() {
 | 
			
		||||
    return core.getBooleanInput(CACHE_WRITEONLY_PARAMETER);
 | 
			
		||||
    return params.isCacheWriteOnly();
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheWriteOnly = isCacheWriteOnly;
 | 
			
		||||
function isCacheDebuggingEnabled() {
 | 
			
		||||
    return process.env[CACHE_DEBUG_VAR] ? true : false;
 | 
			
		||||
    return params.isCacheDebuggingEnabled();
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheDebuggingEnabled = isCacheDebuggingEnabled;
 | 
			
		||||
function isCacheCleanupEnabled() {
 | 
			
		||||
    return core.getBooleanInput(CACHE_CLEANUP_ENABLED_PARAMETER);
 | 
			
		||||
    return params.isCacheCleanupEnabled();
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheCleanupEnabled = isCacheCleanupEnabled;
 | 
			
		||||
class CacheKey {
 | 
			
		||||
@@ -63549,7 +63543,7 @@ function generateCacheKey(cacheName) {
 | 
			
		||||
    const cacheKeyForJob = `${cacheKeyForEnvironment}|${getCacheKeyJob()}`;
 | 
			
		||||
    const cacheKeyForJobContext = `${cacheKeyForJob}[${getCacheKeyJobInstance()}]`;
 | 
			
		||||
    const cacheKey = `${cacheKeyForJobContext}-${getCacheKeyJobExecution()}`;
 | 
			
		||||
    if (core.getBooleanInput(STRICT_CACHE_MATCH_PARAMETER)) {
 | 
			
		||||
    if (params.isCacheStrictMatch()) {
 | 
			
		||||
        return new CacheKey(cacheKey, [cacheKeyForJobContext]);
 | 
			
		||||
    }
 | 
			
		||||
    return new CacheKey(cacheKey, [cacheKeyForJobContext, cacheKeyForJob, cacheKeyForEnvironment]);
 | 
			
		||||
@@ -63571,7 +63565,7 @@ function getCacheKeyJobInstance() {
 | 
			
		||||
    if (override) {
 | 
			
		||||
        return override;
 | 
			
		||||
    }
 | 
			
		||||
    const workflowJobContext = core.getInput(JOB_CONTEXT_PARAMETER);
 | 
			
		||||
    const workflowJobContext = params.getJobContext();
 | 
			
		||||
    return hashStrings([workflowJobContext]);
 | 
			
		||||
}
 | 
			
		||||
function getCacheKeyJobExecution() {
 | 
			
		||||
@@ -63883,6 +63877,115 @@ class DaemonController {
 | 
			
		||||
exports.DaemonController = DaemonController;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
 | 
			
		||||
/***/ 3885:
 | 
			
		||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
 | 
			
		||||
 | 
			
		||||
"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 (mod) {
 | 
			
		||||
    if (mod && mod.__esModule) return mod;
 | 
			
		||||
    var result = {};
 | 
			
		||||
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
 | 
			
		||||
    __setModuleDefault(result, mod);
 | 
			
		||||
    return result;
 | 
			
		||||
};
 | 
			
		||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
 | 
			
		||||
exports.isJobSummaryEnabled = exports.getGithubToken = exports.getJobContext = exports.getArguments = exports.getGradleExecutable = exports.getGradleVersion = exports.getBuildRootDirectory = exports.getCacheExcludes = exports.getCacheIncludes = exports.isCacheCleanupEnabled = exports.isCacheDebuggingEnabled = exports.isCacheStrictMatch = exports.isCacheWriteOnly = exports.isCacheReadOnly = exports.isCacheDisabled = void 0;
 | 
			
		||||
const core = __importStar(__nccwpck_require__(2186));
 | 
			
		||||
const string_argv_1 = __nccwpck_require__(9663);
 | 
			
		||||
function isCacheDisabled() {
 | 
			
		||||
    return getBooleanInput('cache-disabled');
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheDisabled = isCacheDisabled;
 | 
			
		||||
function isCacheReadOnly() {
 | 
			
		||||
    return getBooleanInput('cache-read-only');
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheReadOnly = isCacheReadOnly;
 | 
			
		||||
function isCacheWriteOnly() {
 | 
			
		||||
    return getBooleanInput('cache-write-only');
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheWriteOnly = isCacheWriteOnly;
 | 
			
		||||
function isCacheStrictMatch() {
 | 
			
		||||
    return getBooleanInput('gradle-home-cache-strict-match');
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheStrictMatch = isCacheStrictMatch;
 | 
			
		||||
function isCacheDebuggingEnabled() {
 | 
			
		||||
    return process.env['GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED'] ? true : false;
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheDebuggingEnabled = isCacheDebuggingEnabled;
 | 
			
		||||
function isCacheCleanupEnabled() {
 | 
			
		||||
    return getBooleanInput('gradle-home-cache-cleanup');
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheCleanupEnabled = isCacheCleanupEnabled;
 | 
			
		||||
function getCacheIncludes() {
 | 
			
		||||
    return core.getMultilineInput('gradle-home-cache-includes');
 | 
			
		||||
}
 | 
			
		||||
exports.getCacheIncludes = getCacheIncludes;
 | 
			
		||||
function getCacheExcludes() {
 | 
			
		||||
    return core.getMultilineInput('gradle-home-cache-excludes');
 | 
			
		||||
}
 | 
			
		||||
exports.getCacheExcludes = getCacheExcludes;
 | 
			
		||||
function getBuildRootDirectory() {
 | 
			
		||||
    return core.getInput('build-root-directory');
 | 
			
		||||
}
 | 
			
		||||
exports.getBuildRootDirectory = getBuildRootDirectory;
 | 
			
		||||
function getGradleVersion() {
 | 
			
		||||
    return core.getInput('gradle-version');
 | 
			
		||||
}
 | 
			
		||||
exports.getGradleVersion = getGradleVersion;
 | 
			
		||||
function getGradleExecutable() {
 | 
			
		||||
    return core.getInput('gradle-executable');
 | 
			
		||||
}
 | 
			
		||||
exports.getGradleExecutable = getGradleExecutable;
 | 
			
		||||
function getArguments() {
 | 
			
		||||
    const input = core.getInput('arguments');
 | 
			
		||||
    return (0, string_argv_1.parseArgsStringToArgv)(input);
 | 
			
		||||
}
 | 
			
		||||
exports.getArguments = getArguments;
 | 
			
		||||
function getJobContext() {
 | 
			
		||||
    return core.getInput('workflow-job-context');
 | 
			
		||||
}
 | 
			
		||||
exports.getJobContext = getJobContext;
 | 
			
		||||
function getGithubToken() {
 | 
			
		||||
    return core.getInput('github-token', { required: true });
 | 
			
		||||
}
 | 
			
		||||
exports.getGithubToken = getGithubToken;
 | 
			
		||||
function isJobSummaryEnabled() {
 | 
			
		||||
    return getBooleanInput('generate-job-summary', true);
 | 
			
		||||
}
 | 
			
		||||
exports.isJobSummaryEnabled = isJobSummaryEnabled;
 | 
			
		||||
function getBooleanInput(paramName, paramDefault = false) {
 | 
			
		||||
    const paramValue = core.getInput(paramName);
 | 
			
		||||
    switch (paramValue.toLowerCase().trim()) {
 | 
			
		||||
        case '':
 | 
			
		||||
            return paramDefault;
 | 
			
		||||
        case 'false':
 | 
			
		||||
            return false;
 | 
			
		||||
        case 'true':
 | 
			
		||||
            return true;
 | 
			
		||||
    }
 | 
			
		||||
    throw TypeError(`The value '${paramValue} is not valid for '${paramName}. Valid values are: [true, false]`);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
 | 
			
		||||
/***/ 7345:
 | 
			
		||||
@@ -64070,6 +64173,55 @@ function handleFailure(error) {
 | 
			
		||||
run();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
 | 
			
		||||
/***/ 8182:
 | 
			
		||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
 | 
			
		||||
 | 
			
		||||
"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 (mod) {
 | 
			
		||||
    if (mod && mod.__esModule) return mod;
 | 
			
		||||
    var result = {};
 | 
			
		||||
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
 | 
			
		||||
    __setModuleDefault(result, mod);
 | 
			
		||||
    return result;
 | 
			
		||||
};
 | 
			
		||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
 | 
			
		||||
exports.buildRootDirectory = exports.workspaceDirectory = void 0;
 | 
			
		||||
const params = __importStar(__nccwpck_require__(3885));
 | 
			
		||||
const path = __importStar(__nccwpck_require__(1017));
 | 
			
		||||
function workspaceDirectory() {
 | 
			
		||||
    return process.env[`GITHUB_WORKSPACE`] || '';
 | 
			
		||||
}
 | 
			
		||||
exports.workspaceDirectory = workspaceDirectory;
 | 
			
		||||
function buildRootDirectory() {
 | 
			
		||||
    const baseDirectory = workspaceDirectory();
 | 
			
		||||
    const buildRootDirectoryInput = params.getBuildRootDirectory();
 | 
			
		||||
    const resolvedBuildRootDirectory = buildRootDirectoryInput === ''
 | 
			
		||||
        ? path.resolve(baseDirectory)
 | 
			
		||||
        : path.resolve(baseDirectory, buildRootDirectoryInput);
 | 
			
		||||
    return resolvedBuildRootDirectory;
 | 
			
		||||
}
 | 
			
		||||
exports.buildRootDirectory = buildRootDirectory;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
 | 
			
		||||
/***/ 8652:
 | 
			
		||||
@@ -64117,6 +64269,8 @@ const summary_1 = __nccwpck_require__(1327);
 | 
			
		||||
const path = __importStar(__nccwpck_require__(1017));
 | 
			
		||||
const os = __importStar(__nccwpck_require__(2037));
 | 
			
		||||
const caches = __importStar(__nccwpck_require__(3800));
 | 
			
		||||
const layout = __importStar(__nccwpck_require__(8182));
 | 
			
		||||
const params = __importStar(__nccwpck_require__(3885));
 | 
			
		||||
const job_summary_1 = __nccwpck_require__(7345);
 | 
			
		||||
const build_results_1 = __nccwpck_require__(2107);
 | 
			
		||||
const cache_reporting_1 = __nccwpck_require__(6674);
 | 
			
		||||
@@ -64124,16 +64278,9 @@ const daemon_controller_1 = __nccwpck_require__(5146);
 | 
			
		||||
const GRADLE_SETUP_VAR = 'GRADLE_BUILD_ACTION_SETUP_COMPLETED';
 | 
			
		||||
const GRADLE_USER_HOME = 'GRADLE_USER_HOME';
 | 
			
		||||
const CACHE_LISTENER = 'CACHE_LISTENER';
 | 
			
		||||
const JOB_SUMMARY_ENABLED_PARAMETER = 'generate-job-summary';
 | 
			
		||||
function shouldGenerateJobSummary() {
 | 
			
		||||
    if (!process.env[summary_1.SUMMARY_ENV_VAR]) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    return core.getBooleanInput(JOB_SUMMARY_ENABLED_PARAMETER);
 | 
			
		||||
}
 | 
			
		||||
function setup(buildRootDirectory) {
 | 
			
		||||
function setup() {
 | 
			
		||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
			
		||||
        const gradleUserHome = yield determineGradleUserHome(buildRootDirectory);
 | 
			
		||||
        const gradleUserHome = yield determineGradleUserHome();
 | 
			
		||||
        if (process.env[GRADLE_SETUP_VAR]) {
 | 
			
		||||
            core.info('Gradle setup only performed on first gradle-build-action step in workflow.');
 | 
			
		||||
            return;
 | 
			
		||||
@@ -64168,10 +64315,11 @@ function complete() {
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
exports.complete = complete;
 | 
			
		||||
function determineGradleUserHome(rootDir) {
 | 
			
		||||
function determineGradleUserHome() {
 | 
			
		||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
			
		||||
        const customGradleUserHome = process.env['GRADLE_USER_HOME'];
 | 
			
		||||
        if (customGradleUserHome) {
 | 
			
		||||
            const rootDir = layout.workspaceDirectory();
 | 
			
		||||
            return path.resolve(rootDir, customGradleUserHome);
 | 
			
		||||
        }
 | 
			
		||||
        return path.resolve(yield determineUserHome(), '.gradle');
 | 
			
		||||
@@ -64191,6 +64339,12 @@ function determineUserHome() {
 | 
			
		||||
        return userHome;
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
function shouldGenerateJobSummary() {
 | 
			
		||||
    if (!process.env[summary_1.SUMMARY_ENV_VAR]) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    return params.isJobSummaryEnabled();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
@@ -64353,6 +64507,59 @@ module.exports = require("util");
 | 
			
		||||
"use strict";
 | 
			
		||||
module.exports = require("zlib");
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
 | 
			
		||||
/***/ 9663:
 | 
			
		||||
/***/ ((__unused_webpack_module, exports) => {
 | 
			
		||||
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
exports.__esModule = true;
 | 
			
		||||
exports.parseArgsStringToArgv = void 0;
 | 
			
		||||
function parseArgsStringToArgv(value, env, file) {
 | 
			
		||||
    // ([^\s'"]([^\s'"]*(['"])([^\3]*?)\3)+[^\s'"]*) Matches nested quotes until the first space outside of quotes
 | 
			
		||||
    // [^\s'"]+ or Match if not a space ' or "
 | 
			
		||||
    // (['"])([^\5]*?)\5 or Match "quoted text" without quotes
 | 
			
		||||
    // `\3` and `\5` are a backreference to the quote style (' or ") captured
 | 
			
		||||
    var myRegexp = /([^\s'"]([^\s'"]*(['"])([^\3]*?)\3)+[^\s'"]*)|[^\s'"]+|(['"])([^\5]*?)\5/gi;
 | 
			
		||||
    var myString = value;
 | 
			
		||||
    var myArray = [];
 | 
			
		||||
    if (env) {
 | 
			
		||||
        myArray.push(env);
 | 
			
		||||
    }
 | 
			
		||||
    if (file) {
 | 
			
		||||
        myArray.push(file);
 | 
			
		||||
    }
 | 
			
		||||
    var match;
 | 
			
		||||
    do {
 | 
			
		||||
        // Each call to exec returns the next regex match as an array
 | 
			
		||||
        match = myRegexp.exec(myString);
 | 
			
		||||
        if (match !== null) {
 | 
			
		||||
            // Index 1 in the array is the captured group if it exists
 | 
			
		||||
            // Index 0 is the matched text, which we use if no captured group exists
 | 
			
		||||
            myArray.push(firstString(match[1], match[6], match[0]));
 | 
			
		||||
        }
 | 
			
		||||
    } while (match !== null);
 | 
			
		||||
    return myArray;
 | 
			
		||||
}
 | 
			
		||||
exports["default"] = parseArgsStringToArgv;
 | 
			
		||||
exports.parseArgsStringToArgv = parseArgsStringToArgv;
 | 
			
		||||
// Accepts any number of arguments, and returns the first one that is a string
 | 
			
		||||
// (even an empty string)
 | 
			
		||||
function firstString() {
 | 
			
		||||
    var args = [];
 | 
			
		||||
    for (var _i = 0; _i < arguments.length; _i++) {
 | 
			
		||||
        args[_i] = arguments[_i];
 | 
			
		||||
    }
 | 
			
		||||
    for (var i = 0; i < args.length; i++) {
 | 
			
		||||
        var arg = args[i];
 | 
			
		||||
        if (typeof arg === "string") {
 | 
			
		||||
            return arg;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
 | 
			
		||||
/***/ 3765:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/post/index.js.map
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/post/index.js.map
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user