mirror of https://github.com/actions/toolkit
Add await to async function calls
parent
424ae62ee7
commit
afbc5c0a9e
|
@ -240,7 +240,11 @@ export async function listTar(
|
||||||
compressionMethod: CompressionMethod
|
compressionMethod: CompressionMethod
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const args = await getArgs(compressionMethod, 'list', archivePath)
|
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(
|
export async function extractTar(
|
||||||
|
@ -251,7 +255,11 @@ export async function extractTar(
|
||||||
const workingDirectory = getWorkingDirectory()
|
const workingDirectory = getWorkingDirectory()
|
||||||
await io.mkdirP(workingDirectory)
|
await io.mkdirP(workingDirectory)
|
||||||
const args = await getArgs(compressionMethod, 'extract', archivePath)
|
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(
|
export async function createTar(
|
||||||
|
@ -265,5 +273,9 @@ export async function createTar(
|
||||||
sourceDirectories.join('\n')
|
sourceDirectories.join('\n')
|
||||||
)
|
)
|
||||||
const args = await getArgs(compressionMethod, 'create')
|
const args = await getArgs(compressionMethod, 'create')
|
||||||
await exec(args, undefined, {cwd: archiveFolder})
|
try {
|
||||||
|
await exec(args, undefined, {cwd: archiveFolder})
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(`Tar failed with error: ${error?.message}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue