mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Add ppa:ondrej/php for all Ubuntu versions
This commit is contained in:
parent
698464efea
commit
8bed24ebe1
149
dist/index.js
vendored
149
dist/index.js
vendored
@ -1,4 +1,3 @@
|
|||||||
module.exports =
|
|
||||||
/******/ (() => { // webpackBootstrap
|
/******/ (() => { // webpackBootstrap
|
||||||
/******/ "use strict";
|
/******/ "use strict";
|
||||||
/******/ var __webpack_modules__ = ({
|
/******/ var __webpack_modules__ = ({
|
||||||
@ -1193,6 +1192,7 @@ exports.getInput = getInput;
|
|||||||
*/
|
*/
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
function setOutput(name, value) {
|
function setOutput(name, value) {
|
||||||
|
process.stdout.write(os.EOL);
|
||||||
command_1.issueCommand('set-output', { name }, value);
|
command_1.issueCommand('set-output', { name }, value);
|
||||||
}
|
}
|
||||||
exports.setOutput = setOutput;
|
exports.setOutput = setOutput;
|
||||||
@ -2057,11 +2057,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
var _a;
|
var _a;
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const assert_1 = __nccwpck_require__(357);
|
const assert_1 = __nccwpck_require__(357);
|
||||||
const fs = __nccwpck_require__(747);
|
const fs = __importStar(__nccwpck_require__(747));
|
||||||
const path = __nccwpck_require__(622);
|
const path = __importStar(__nccwpck_require__(622));
|
||||||
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
|
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
|
||||||
exports.IS_WINDOWS = process.platform === 'win32';
|
exports.IS_WINDOWS = process.platform === 'win32';
|
||||||
function exists(fsPath) {
|
function exists(fsPath) {
|
||||||
@ -2258,11 +2265,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const childProcess = __nccwpck_require__(129);
|
const childProcess = __importStar(__nccwpck_require__(129));
|
||||||
const path = __nccwpck_require__(622);
|
const path = __importStar(__nccwpck_require__(622));
|
||||||
const util_1 = __nccwpck_require__(669);
|
const util_1 = __nccwpck_require__(669);
|
||||||
const ioUtil = __nccwpck_require__(962);
|
const ioUtil = __importStar(__nccwpck_require__(962));
|
||||||
const exec = util_1.promisify(childProcess.exec);
|
const exec = util_1.promisify(childProcess.exec);
|
||||||
/**
|
/**
|
||||||
* Copies a file or folder.
|
* Copies a file or folder.
|
||||||
@ -2430,58 +2444,73 @@ function which(tool, check) {
|
|||||||
throw new Error(`Unable to locate executable file: ${tool}. 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.`);
|
throw new Error(`Unable to locate executable file: ${tool}. 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.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
try {
|
const matches = yield findInPath(tool);
|
||||||
// build the list of extensions to try
|
if (matches && matches.length > 0) {
|
||||||
const extensions = [];
|
return matches[0];
|
||||||
if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
|
|
||||||
for (const extension of process.env.PATHEXT.split(path.delimiter)) {
|
|
||||||
if (extension) {
|
|
||||||
extensions.push(extension);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// if it's rooted, return it if exists. otherwise return empty.
|
|
||||||
if (ioUtil.isRooted(tool)) {
|
|
||||||
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
|
|
||||||
if (filePath) {
|
|
||||||
return filePath;
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
// if any path separators, return empty
|
|
||||||
if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
// build the list of directories
|
|
||||||
//
|
|
||||||
// Note, technically "where" checks the current directory on Windows. From a toolkit 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 toolkit should strive for consistency
|
|
||||||
// across platforms.
|
|
||||||
const directories = [];
|
|
||||||
if (process.env.PATH) {
|
|
||||||
for (const p of process.env.PATH.split(path.delimiter)) {
|
|
||||||
if (p) {
|
|
||||||
directories.push(p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// return the first match
|
|
||||||
for (const directory of directories) {
|
|
||||||
const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
|
|
||||||
if (filePath) {
|
|
||||||
return filePath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
throw new Error(`which failed with message ${err.message}`);
|
|
||||||
}
|
}
|
||||||
|
return '';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.which = which;
|
exports.which = which;
|
||||||
|
/**
|
||||||
|
* Returns a list of all occurrences of the given tool on the system path.
|
||||||
|
*
|
||||||
|
* @returns Promise<string[]> the paths of the tool
|
||||||
|
*/
|
||||||
|
function findInPath(tool) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (!tool) {
|
||||||
|
throw new Error("parameter 'tool' is required");
|
||||||
|
}
|
||||||
|
// build the list of extensions to try
|
||||||
|
const extensions = [];
|
||||||
|
if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
|
||||||
|
for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
|
||||||
|
if (extension) {
|
||||||
|
extensions.push(extension);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if it's rooted, return it if exists. otherwise return empty.
|
||||||
|
if (ioUtil.isRooted(tool)) {
|
||||||
|
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
|
||||||
|
if (filePath) {
|
||||||
|
return [filePath];
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
// if any path separators, return empty
|
||||||
|
if (tool.includes(path.sep)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
// build the list of directories
|
||||||
|
//
|
||||||
|
// Note, technically "where" checks the current directory on Windows. From a toolkit 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 toolkit should strive for consistency
|
||||||
|
// across platforms.
|
||||||
|
const directories = [];
|
||||||
|
if (process.env.PATH) {
|
||||||
|
for (const p of process.env.PATH.split(path.delimiter)) {
|
||||||
|
if (p) {
|
||||||
|
directories.push(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// find all matches
|
||||||
|
const matches = [];
|
||||||
|
for (const directory of directories) {
|
||||||
|
const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
|
||||||
|
if (filePath) {
|
||||||
|
matches.push(filePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return matches;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.findInPath = findInPath;
|
||||||
function readCopyOptions(options) {
|
function readCopyOptions(options) {
|
||||||
const force = options.force == null ? true : options.force;
|
const force = options.force == null ? true : options.force;
|
||||||
const recursive = Boolean(options.recursive);
|
const recursive = Boolean(options.recursive);
|
||||||
@ -2605,8 +2634,9 @@ module.exports = require("util");;
|
|||||||
/******/ // The require function
|
/******/ // The require function
|
||||||
/******/ function __nccwpck_require__(moduleId) {
|
/******/ function __nccwpck_require__(moduleId) {
|
||||||
/******/ // Check if module is in cache
|
/******/ // Check if module is in cache
|
||||||
/******/ if(__webpack_module_cache__[moduleId]) {
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
/******/ return __webpack_module_cache__[moduleId].exports;
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
/******/ }
|
/******/ }
|
||||||
/******/ // Create a new module (and put it into the cache)
|
/******/ // Create a new module (and put it into the cache)
|
||||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
@ -2631,10 +2661,13 @@ module.exports = require("util");;
|
|||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/******/ /* webpack/runtime/compat */
|
/******/ /* webpack/runtime/compat */
|
||||||
/******/
|
/******/
|
||||||
/******/ __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
|
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
|
||||||
/******/ // module exports must be returned from runtime so entry inlining is disabled
|
/******/
|
||||||
/******/ // startup
|
/******/ // startup
|
||||||
/******/ // Load entry module and return exports
|
/******/ // Load entry module and return exports
|
||||||
/******/ return __nccwpck_require__(39);
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
||||||
|
/******/ var __webpack_exports__ = __nccwpck_require__(39);
|
||||||
|
/******/ module.exports = __webpack_exports__;
|
||||||
|
/******/
|
||||||
/******/ })()
|
/******/ })()
|
||||||
;
|
;
|
@ -42,7 +42,7 @@ add_ppa() {
|
|||||||
# Function to update the package lists.
|
# Function to update the package lists.
|
||||||
update_lists() {
|
update_lists() {
|
||||||
if [ ! -e /tmp/setup_php ]; then
|
if [ ! -e /tmp/setup_php ]; then
|
||||||
[ "$DISTRIB_RELEASE" = "20.04" ] && add_ppa ondrej/php >/dev/null 2>&1
|
add_ppa ondrej/php >/dev/null 2>&1
|
||||||
cleanup_lists
|
cleanup_lists
|
||||||
sudo "$debconf_fix" apt-get update >/dev/null 2>&1
|
sudo "$debconf_fix" apt-get update >/dev/null 2>&1
|
||||||
echo '' | sudo tee /tmp/setup_php >/dev/null 2>&1
|
echo '' | sudo tee /tmp/setup_php >/dev/null 2>&1
|
||||||
|
Loading…
Reference in New Issue
Block a user