1
0
Fork 0

Add await to async function calls

pull/1237/head
Sampark Sharma 2022-11-30 06:16:19 +00:00 committed by GitHub
parent 424ae62ee7
commit afbc5c0a9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 3 deletions

View File

@ -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}`)
}
}