fix filepath when using path input

This commit is contained in:
Peter Evans 2024-07-27 21:02:41 +00:00
parent 396429353a
commit 184d576617
3 changed files with 10 additions and 4 deletions

View file

@ -126,6 +126,10 @@ export function readFile(path: string): string {
return fs.readFileSync(path, 'utf-8')
}
export function readFileBase64(pathParts: string[]): string {
return fs.readFileSync(path.resolve(...pathParts)).toString('base64')
}
/* eslint-disable @typescript-eslint/no-explicit-any */
function hasErrorCode(error: any): error is {code: string} {
return typeof (error && error.code) === 'string'