@@ -3,22 +3,25 @@ import { mkdirP } from "@actions/io"
33import which from "which"
44import { setupSevenZip } from "../../sevenzip/sevenzip"
55import { warning } from "../io/io"
6- export { extractTar , extractXar , extract7z , extractZip } from "@actions/tool-cache"
6+ export { extractTar , extractXar , extract7z } from "@actions/tool-cache"
77
88let sevenZip : string | undefined
99
1010export async function extractExe ( file : string , dest : string ) {
11- // install 7z if needed
11+ await execa ( await getSevenZip ( ) , [ "x" , file , `-o${ dest } ` ] , { stdio : "inherit" } )
12+ return dest
13+ }
14+
15+ /// install 7z if needed
16+ async function getSevenZip ( ) {
1217 if ( sevenZip === undefined ) {
1318 if ( which . sync ( "7z" , { nothrow : true } ) === null ) {
1419 await setupSevenZip ( "" , "" , process . arch )
1520 }
1621 // eslint-disable-next-line require-atomic-updates
1722 sevenZip = "7z"
1823 }
19-
20- await execa ( sevenZip , [ "x" , file , `-o${ dest } ` ] , { stdio : "inherit" } )
21- return dest
24+ return sevenZip
2225}
2326
2427export async function extractTarByExe ( file : string , dest : string , flags = [ "--strip-components=0" ] ) {
0 commit comments