mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-22 13:49:13 +08:00
Add await to async function calls
This commit is contained in:
parent
424ae62ee7
commit
afbc5c0a9e
16
packages/cache/src/internal/tar.ts
vendored
16
packages/cache/src/internal/tar.ts
vendored
@ -240,7 +240,11 @@ export async function listTar(
|
||||
compressionMethod: CompressionMethod
|
||||
): Promise<void> {
|
||||
const args = await getArgs(compressionMethod, 'list', archivePath)
|
||||
exec(args)
|
||||
try {
|
||||
await exec(args)
|
||||
} catch (error) {
|
||||
throw new Error(`Tar failed with error: ${error?.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
export async function extractTar(
|
||||
@ -251,7 +255,11 @@ export async function extractTar(
|
||||
const workingDirectory = getWorkingDirectory()
|
||||
await io.mkdirP(workingDirectory)
|
||||
const args = await getArgs(compressionMethod, 'extract', archivePath)
|
||||
exec(args)
|
||||
try {
|
||||
await exec(args)
|
||||
} catch (error) {
|
||||
throw new Error(`Tar failed with error: ${error?.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
export async function createTar(
|
||||
@ -265,5 +273,9 @@ export async function createTar(
|
||||
sourceDirectories.join('\n')
|
||||
)
|
||||
const args = await getArgs(compressionMethod, 'create')
|
||||
try {
|
||||
await exec(args, undefined, {cwd: archiveFolder})
|
||||
} catch (error) {
|
||||
throw new Error(`Tar failed with error: ${error?.message}`)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user