Output stdout upon error in getFileType
This commit is contained in:
parent
df098abd11
commit
4cee553ea6
3 changed files with 9 additions and 9 deletions
8
lib/actions-util.js
generated
8
lib/actions-util.js
generated
|
|
@ -385,23 +385,23 @@ exports.getWorkflowRunAttempt = getWorkflowRunAttempt;
|
||||||
*/
|
*/
|
||||||
const getFileType = async (fp) => {
|
const getFileType = async (fp) => {
|
||||||
let stderr = "";
|
let stderr = "";
|
||||||
|
let stdout = "";
|
||||||
try {
|
try {
|
||||||
let fileOut = "";
|
|
||||||
await new toolrunner.ToolRunner(await safeWhich.safeWhich("file"), ["-L", fp], {
|
await new toolrunner.ToolRunner(await safeWhich.safeWhich("file"), ["-L", fp], {
|
||||||
silent: true,
|
silent: true,
|
||||||
listeners: {
|
listeners: {
|
||||||
stdout: (data) => {
|
stdout: (data) => {
|
||||||
fileOut += data.toString();
|
stdout += data.toString();
|
||||||
},
|
},
|
||||||
stderr: (data) => {
|
stderr: (data) => {
|
||||||
stderr += data.toString();
|
stderr += data.toString();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}).exec();
|
}).exec();
|
||||||
return fileOut;
|
return stdout;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
core.info(`Could not determine type of ${fp}. ${stderr}`);
|
core.info(`Could not determine type of ${fp} from ${stdout}. ${stderr}`);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -431,8 +431,8 @@ export function getWorkflowRunAttempt(): number {
|
||||||
*/
|
*/
|
||||||
export const getFileType = async (fp: string): Promise<string> => {
|
export const getFileType = async (fp: string): Promise<string> => {
|
||||||
let stderr = "";
|
let stderr = "";
|
||||||
|
let stdout = "";
|
||||||
try {
|
try {
|
||||||
let fileOut = "";
|
|
||||||
await new toolrunner.ToolRunner(
|
await new toolrunner.ToolRunner(
|
||||||
await safeWhich.safeWhich("file"),
|
await safeWhich.safeWhich("file"),
|
||||||
["-L", fp],
|
["-L", fp],
|
||||||
|
|
@ -440,7 +440,7 @@ export const getFileType = async (fp: string): Promise<string> => {
|
||||||
silent: true,
|
silent: true,
|
||||||
listeners: {
|
listeners: {
|
||||||
stdout: (data) => {
|
stdout: (data) => {
|
||||||
fileOut += data.toString();
|
stdout += data.toString();
|
||||||
},
|
},
|
||||||
stderr: (data) => {
|
stderr: (data) => {
|
||||||
stderr += data.toString();
|
stderr += data.toString();
|
||||||
|
|
@ -448,9 +448,9 @@ export const getFileType = async (fp: string): Promise<string> => {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
).exec();
|
).exec();
|
||||||
return fileOut;
|
return stdout;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
core.info(`Could not determine type of ${fp}. ${stderr}`);
|
core.info(`Could not determine type of ${fp} from ${stdout}. ${stderr}`);
|
||||||
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue