Remove `a` flag
This commit is contained in:
parent
0886129cab
commit
0aa09ca7c5
|
@ -30470,7 +30470,7 @@ const path = __nccwpck_require__(1017);
|
||||||
const os = __nccwpck_require__(2037);
|
const os = __nccwpck_require__(2037);
|
||||||
|
|
||||||
function getInput(name, dflt) {
|
function getInput(name, dflt) {
|
||||||
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`];
|
const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`];
|
||||||
if (!val) {
|
if (!val) {
|
||||||
return dflt;
|
return dflt;
|
||||||
}
|
}
|
||||||
|
@ -30478,23 +30478,32 @@ function getInput(name, dflt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function addLocalPath(inputPath) {
|
function addLocalPath(inputPath) {
|
||||||
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`
|
process.env["PATH"] = `${inputPath}${path.delimiter}${process.env["PATH"]}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
const base_url = core.getInput('base_url');
|
const base_url = core.getInput("base_url");
|
||||||
const os_name = getInput('os_name', process.env['OS_NAME']);
|
const os_name = getInput("os_name", process.env["OS_NAME"]);
|
||||||
const target = core.getInput('target_platform');
|
const target = core.getInput("target_platform");
|
||||||
const project = getInput('project', process.env['GITHUB_REPOSITORY'].split('/')[1]);
|
const project = getInput(
|
||||||
const branch = getInput('branch', process.env['GITHUB_HEAD_REF']||process.env['GITHUB_REF_NAME']);
|
"project",
|
||||||
const extract_dir = getInput('extract_dir', process.env['HOME']||process.env['GITHUB_WORKSPACE']);
|
process.env["GITHUB_REPOSITORY"].split("/")[1],
|
||||||
|
);
|
||||||
|
const branch = getInput(
|
||||||
|
"branch",
|
||||||
|
process.env["GITHUB_HEAD_REF"] || process.env["GITHUB_REF_NAME"],
|
||||||
|
);
|
||||||
|
const extract_dir = getInput(
|
||||||
|
"extract_dir",
|
||||||
|
process.env["HOME"] || process.env["GITHUB_WORKSPACE"],
|
||||||
|
);
|
||||||
|
|
||||||
let archivePath;
|
let archivePath;
|
||||||
try {
|
try {
|
||||||
const archive_url = `${base_url}/dev_preview/${branch}/deps2_${os_name}_${target}_${project}.tar.xz`;
|
const archive_url = `${base_url}/dev_preview/${branch}/deps2_${os_name}_${target}_${project}.tar.xz`;
|
||||||
process.stdout.write("Downloading " + archive_url + "\n");
|
process.stdout.write("Downloading " + archive_url + "\n");
|
||||||
archivePath = await tc.downloadTool(archive_url);
|
archivePath = await tc.downloadTool(archive_url);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const archive_url = `${base_url}/deps2_${os_name}_${target}_${project}.tar.xz`;
|
const archive_url = `${base_url}/deps2_${os_name}_${target}_${project}.tar.xz`;
|
||||||
process.stdout.write("Downloading " + archive_url + "\n");
|
process.stdout.write("Downloading " + archive_url + "\n");
|
||||||
|
@ -30502,19 +30511,19 @@ async function run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
process.stdout.write("Extracting " + archivePath + " to " + extract_dir);
|
process.stdout.write("Extracting " + archivePath + " to " + extract_dir);
|
||||||
const archive_dir = await tc.extractTar(archivePath, extract_dir, 'xa');
|
const archive_dir = await tc.extractTar(archivePath, extract_dir, "x");
|
||||||
process.stdout.write("Extracted to " + archive_dir);
|
process.stdout.write("Extracted to " + archive_dir);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (os.platform() === 'win32') {
|
if (os.platform() === "win32") {
|
||||||
addLocalPath('C:\\Program Files\\Git\\usr\\bin');
|
addLocalPath("C:\\Program Files\\Git\\usr\\bin");
|
||||||
}
|
}
|
||||||
core.setCommandEcho(true);
|
core.setCommandEcho(true);
|
||||||
|
|
||||||
run()
|
run();
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
const tc = require('@actions/tool-cache');
|
const tc = require("@actions/tool-cache");
|
||||||
const core = require('@actions/core');
|
const core = require("@actions/core");
|
||||||
const path = require('path');
|
const path = require("path");
|
||||||
const os = require('os');
|
const os = require("os");
|
||||||
|
|
||||||
function getInput(name, dflt) {
|
function getInput(name, dflt) {
|
||||||
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`];
|
const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`];
|
||||||
if (!val) {
|
if (!val) {
|
||||||
return dflt;
|
return dflt;
|
||||||
}
|
}
|
||||||
|
@ -12,23 +12,32 @@ function getInput(name, dflt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function addLocalPath(inputPath) {
|
function addLocalPath(inputPath) {
|
||||||
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`
|
process.env["PATH"] = `${inputPath}${path.delimiter}${process.env["PATH"]}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
const base_url = core.getInput('base_url');
|
const base_url = core.getInput("base_url");
|
||||||
const os_name = getInput('os_name', process.env['OS_NAME']);
|
const os_name = getInput("os_name", process.env["OS_NAME"]);
|
||||||
const target = core.getInput('target_platform');
|
const target = core.getInput("target_platform");
|
||||||
const project = getInput('project', process.env['GITHUB_REPOSITORY'].split('/')[1]);
|
const project = getInput(
|
||||||
const branch = getInput('branch', process.env['GITHUB_HEAD_REF']||process.env['GITHUB_REF_NAME']);
|
"project",
|
||||||
const extract_dir = getInput('extract_dir', process.env['HOME']||process.env['GITHUB_WORKSPACE']);
|
process.env["GITHUB_REPOSITORY"].split("/")[1],
|
||||||
|
);
|
||||||
|
const branch = getInput(
|
||||||
|
"branch",
|
||||||
|
process.env["GITHUB_HEAD_REF"] || process.env["GITHUB_REF_NAME"],
|
||||||
|
);
|
||||||
|
const extract_dir = getInput(
|
||||||
|
"extract_dir",
|
||||||
|
process.env["HOME"] || process.env["GITHUB_WORKSPACE"],
|
||||||
|
);
|
||||||
|
|
||||||
let archivePath;
|
let archivePath;
|
||||||
try {
|
try {
|
||||||
const archive_url = `${base_url}/dev_preview/${branch}/deps2_${os_name}_${target}_${project}.tar.xz`;
|
const archive_url = `${base_url}/dev_preview/${branch}/deps2_${os_name}_${target}_${project}.tar.xz`;
|
||||||
process.stdout.write("Downloading " + archive_url + "\n");
|
process.stdout.write("Downloading " + archive_url + "\n");
|
||||||
archivePath = await tc.downloadTool(archive_url);
|
archivePath = await tc.downloadTool(archive_url);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const archive_url = `${base_url}/deps2_${os_name}_${target}_${project}.tar.xz`;
|
const archive_url = `${base_url}/deps2_${os_name}_${target}_${project}.tar.xz`;
|
||||||
process.stdout.write("Downloading " + archive_url + "\n");
|
process.stdout.write("Downloading " + archive_url + "\n");
|
||||||
|
@ -36,16 +45,16 @@ async function run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
process.stdout.write("Extracting " + archivePath + " to " + extract_dir);
|
process.stdout.write("Extracting " + archivePath + " to " + extract_dir);
|
||||||
const archive_dir = await tc.extractTar(archivePath, extract_dir, 'xa');
|
const archive_dir = await tc.extractTar(archivePath, extract_dir, "x");
|
||||||
process.stdout.write("Extracted to " + archive_dir);
|
process.stdout.write("Extracted to " + archive_dir);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (os.platform() === 'win32') {
|
if (os.platform() === "win32") {
|
||||||
addLocalPath('C:\\Program Files\\Git\\usr\\bin');
|
addLocalPath("C:\\Program Files\\Git\\usr\\bin");
|
||||||
}
|
}
|
||||||
core.setCommandEcho(true);
|
core.setCommandEcho(true);
|
||||||
|
|
||||||
run()
|
run();
|
||||||
|
|
Loading…
Reference in New Issue