@@ -18,7 +18,6 @@ import semverValid from "semver/functions/valid"
18
18
import { getVersion } from "./default_versions"
19
19
import { InstallationInfo } from "./utils/setup/setupBin"
20
20
import { setupGcc } from "./gcc/gcc"
21
- import { assert } from "console"
22
21
23
22
const tools = [
24
23
"cmake" ,
@@ -119,22 +118,45 @@ export async function main(): Promise<number> {
119
118
}
120
119
}
121
120
121
+ const toolsSucceeded : string [ ] = [ ]
122
+ const toolsErrored : string [ ] = [ ]
122
123
for ( const tool of tools ) {
123
- assert ( tool in setups )
124
124
const version = maybeGetInput ( tool )
125
125
if ( version !== undefined ) {
126
126
const setupFunction = setups [ tool ]
127
- // eslint-disable-next-line no-await-in-loop
128
- await setupFunction ( getVersion ( tool , version ) , setupCppDir , arch )
127
+
128
+ try {
129
+ // eslint-disable-next-line no-await-in-loop
130
+ const installationInfo = await setupFunction ( getVersion ( tool , version ) , setupCppDir , arch )
131
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
132
+ if ( installationInfo !== undefined ) {
133
+ let success = `${ tool } was successfully installed`
134
+ if ( installationInfo . installDir !== undefined ) {
135
+ success += `\nThe installation direcotry is ${ installationInfo . installDir } `
136
+ }
137
+ if ( installationInfo . binDir ) {
138
+ success += `\nThe binary direcotry is ${ installationInfo . binDir } `
139
+ }
140
+ toolsSucceeded . push ( success )
141
+ } else {
142
+ toolsSucceeded . push ( `${ tool } was successfully installed` )
143
+ }
144
+ } catch ( e ) {
145
+ toolsErrored . push ( `${ tool } failed to install` )
146
+ }
129
147
}
130
148
}
149
+
150
+ console . log ( "\n\n\n" )
151
+ toolsSucceeded . forEach ( ( tool ) => core . info ( tool ) )
152
+ toolsErrored . forEach ( ( tool ) => core . error ( tool ) )
131
153
} catch ( err ) {
132
154
core . error ( err as string | Error )
133
155
core . setFailed ( "install-cpp failed" )
134
156
return 1
135
157
}
136
158
137
- core . info ( "install-cpp succeeded " )
159
+ core . info ( "install-cpp finished " )
138
160
return 0
139
161
}
140
162
0 commit comments