@@ -111,7 +111,7 @@ export class Install {
111
111
return tooldir ;
112
112
}
113
113
114
- public async install ( ) : Promise < void > {
114
+ public async install ( ) : Promise < string > {
115
115
if ( ! this . toolDir ) {
116
116
throw new Error ( 'toolDir must be set. Run download first.' ) ;
117
117
}
@@ -120,24 +120,21 @@ export class Install {
120
120
}
121
121
switch ( os . platform ( ) ) {
122
122
case 'darwin' : {
123
- await this . installDarwin ( ) ;
124
- break ;
123
+ return await this . installDarwin ( ) ;
125
124
}
126
125
case 'linux' : {
127
- await this . installLinux ( ) ;
128
- break ;
126
+ return await this . installLinux ( ) ;
129
127
}
130
128
case 'win32' : {
131
- await this . installWindows ( ) ;
132
- break ;
129
+ return await this . installWindows ( ) ;
133
130
}
134
131
default : {
135
132
throw new Error ( `Unsupported platform: ${ os . platform ( ) } ` ) ;
136
133
}
137
134
}
138
135
}
139
136
140
- private async installDarwin ( ) : Promise < void > {
137
+ private async installDarwin ( ) : Promise < string > {
141
138
const limaDir = path . join ( os . homedir ( ) , '.lima' , this . limaInstanceName ) ;
142
139
await io . mkdirP ( limaDir ) ;
143
140
const dockerHost = `unix://${ limaDir } /docker.sock` ;
@@ -225,9 +222,11 @@ export class Install {
225
222
await Exec . exec ( 'docker' , [ 'context' , 'create' , this . contextName , '--docker' , `host=${ dockerHost } ` ] ) ;
226
223
await Exec . exec ( 'docker' , [ 'context' , 'use' , this . contextName ] ) ;
227
224
} ) ;
225
+
226
+ return dockerHost ;
228
227
}
229
228
230
- private async installLinux ( ) : Promise < void > {
229
+ private async installLinux ( ) : Promise < string > {
231
230
const dockerHost = `unix://${ path . join ( this . runDir , 'docker.sock' ) } ` ;
232
231
await io . mkdirP ( this . runDir ) ;
233
232
@@ -306,9 +305,11 @@ EOF`,
306
305
await Exec . exec ( 'docker' , [ 'context' , 'create' , this . contextName , '--docker' , `host=${ dockerHost } ` ] ) ;
307
306
await Exec . exec ( 'docker' , [ 'context' , 'use' , this . contextName ] ) ;
308
307
} ) ;
308
+
309
+ return dockerHost ;
309
310
}
310
311
311
- private async installWindows ( ) : Promise < void > {
312
+ private async installWindows ( ) : Promise < string > {
312
313
const dockerHost = 'npipe:////./pipe/setup_docker_action' ;
313
314
314
315
let daemonConfig = undefined ;
@@ -347,6 +348,8 @@ EOF`,
347
348
await Exec . exec ( 'docker' , [ 'context' , 'create' , this . contextName , '--docker' , `host=${ dockerHost } ` ] ) ;
348
349
await Exec . exec ( 'docker' , [ 'context' , 'use' , this . contextName ] ) ;
349
350
} ) ;
351
+
352
+ return dockerHost ;
350
353
}
351
354
352
355
public async tearDown ( ) : Promise < void > {
0 commit comments