@@ -18,18 +18,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
1818 __setModuleDefault ( result , mod ) ;
1919 return result ;
2020} ;
21- var __importDefault = ( this && this . __importDefault ) || function ( mod ) {
22- return ( mod && mod . __esModule ) ? mod : { "default" : mod } ;
23- } ;
2421Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
2522exports . unixInstall = void 0 ;
26- const core_1 = __importDefault ( require ( "@actions/core" ) ) ;
23+ const core = __importStar ( require ( "@actions/core" ) ) ;
2724const exec_1 = require ( "@actions/exec" ) ;
28- const io_1 = __importDefault ( require ( "@actions/io" ) ) ;
29- const tool_cache_1 = __importDefault ( require ( "@actions/tool-cache" ) ) ;
30- const os_1 = __importDefault ( require ( "os" ) ) ;
31- const path_1 = __importDefault ( require ( "path" ) ) ;
32- const semver_1 = __importDefault ( require ( "semver" ) ) ;
25+ const io = __importStar ( require ( "@actions/io" ) ) ;
26+ const toolCache = __importStar ( require ( "@actions/tool-cache" ) ) ;
27+ const os = __importStar ( require ( "os" ) ) ;
28+ const path = __importStar ( require ( "path" ) ) ;
29+ const semver = __importStar ( require ( "semver" ) ) ;
3330const git = __importStar ( require ( "./git" ) ) ;
3431async function install ( sourceDir , binDir ) {
3532 await exec_1 . exec ( 'make' , [ 'build' ] , { cwd : sourceDir } ) ;
@@ -39,31 +36,31 @@ async function unixInstall(version) {
3936 let toolDir ;
4037 if ( version . type !== 'local' ) {
4138 const ver = version . version ;
42- toolDir = tool_cache_1 . default . find ( 'xmake' , ver ) ;
39+ toolDir = toolCache . find ( 'xmake' , ver ) ;
4340 if ( ! toolDir ) {
44- const sourceDir = await core_1 . default . group ( `download xmake ${ String ( version ) } ` , ( ) => git . create ( version . repo , version . sha ) ) ;
45- toolDir = await core_1 . default . group ( `install xmake ${ String ( version ) } ` , async ( ) => {
46- const binDir = path_1 . default . join ( os_1 . default . tmpdir ( ) , `xmake-${ version . sha } ` ) ;
41+ const sourceDir = await core . group ( `download xmake ${ String ( version ) } ` , ( ) => git . create ( version . repo , version . sha ) ) ;
42+ toolDir = await core . group ( `install xmake ${ String ( version ) } ` , async ( ) => {
43+ const binDir = path . join ( os . tmpdir ( ) , `xmake-${ version . sha } ` ) ;
4744 await install ( sourceDir , binDir ) ;
48- const cacheDir = await tool_cache_1 . default . cacheDir ( binDir , 'xmake' , ver ) ;
49- await io_1 . default . rmRF ( binDir ) ;
45+ const cacheDir = await toolCache . cacheDir ( binDir , 'xmake' , ver ) ;
46+ await io . rmRF ( binDir ) ;
5047 await git . cleanup ( version . sha ) ;
5148 return cacheDir ;
5249 } ) ;
5350 }
5451 }
5552 else {
56- toolDir = await core_1 . default . group ( `install local xmake at '${ version . path } '` , async ( ) => {
57- const binDir = path_1 . default . join ( os_1 . default . tmpdir ( ) , `xmake-${ Date . now ( ) } ` ) ;
53+ toolDir = await core . group ( `install local xmake at '${ version . path } '` , async ( ) => {
54+ const binDir = path . join ( os . tmpdir ( ) , `xmake-${ Date . now ( ) } ` ) ;
5855 await install ( version . path , binDir ) ;
5956 return binDir ;
6057 } ) ;
6158 }
62- if ( version . type !== 'tags' || semver_1 . default . gt ( version . version , '2.3.1' ) ) {
63- core_1 . default . addPath ( path_1 . default . join ( toolDir , 'bin' ) ) ;
59+ if ( version . type !== 'tags' || semver . gt ( version . version , '2.3.1' ) ) {
60+ core . addPath ( path . join ( toolDir , 'bin' ) ) ;
6461 }
6562 else {
66- core_1 . default . addPath ( path_1 . default . join ( toolDir , 'share' , 'xmake' ) ) ;
63+ core . addPath ( path . join ( toolDir , 'share' , 'xmake' ) ) ;
6764 }
6865}
6966exports . unixInstall = unixInstall ;
0 commit comments