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) => {
|
||||
let stderr = "";
|
||||
let stdout = "";
|
||||
try {
|
||||
let fileOut = "";
|
||||
await new toolrunner.ToolRunner(await safeWhich.safeWhich("file"), ["-L", fp], {
|
||||
silent: true,
|
||||
listeners: {
|
||||
stdout: (data) => {
|
||||
fileOut += data.toString();
|
||||
stdout += data.toString();
|
||||
},
|
||||
stderr: (data) => {
|
||||
stderr += data.toString();
|
||||
},
|
||||
},
|
||||
}).exec();
|
||||
return fileOut;
|
||||
return stdout;
|
||||
}
|
||||
catch (e) {
|
||||
core.info(`Could not determine type of ${fp}. ${stderr}`);
|
||||
core.info(`Could not determine type of ${fp} from ${stdout}. ${stderr}`);
|
||||
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> => {
|
||||
let stderr = "";
|
||||
let stdout = "";
|
||||
try {
|
||||
let fileOut = "";
|
||||
await new toolrunner.ToolRunner(
|
||||
await safeWhich.safeWhich("file"),
|
||||
["-L", fp],
|
||||
|
|
@ -440,7 +440,7 @@ export const getFileType = async (fp: string): Promise<string> => {
|
|||
silent: true,
|
||||
listeners: {
|
||||
stdout: (data) => {
|
||||
fileOut += data.toString();
|
||||
stdout += data.toString();
|
||||
},
|
||||
stderr: (data) => {
|
||||
stderr += data.toString();
|
||||
|
|
@ -448,9 +448,9 @@ export const getFileType = async (fp: string): Promise<string> => {
|
|||
},
|
||||
},
|
||||
).exec();
|
||||
return fileOut;
|
||||
return stdout;
|
||||
} catch (e) {
|
||||
core.info(`Could not determine type of ${fp}. ${stderr}`);
|
||||
core.info(`Could not determine type of ${fp} from ${stdout}. ${stderr}`);
|
||||
|
||||
throw e;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue