File tree Expand file tree Collapse file tree 3 files changed +10
-25
lines changed Expand file tree Collapse file tree 3 files changed +10
-25
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " nerdctl" ,
3- "version" : " 0.0.6 " ,
3+ "version" : " 0.0.7 " ,
44 "main" : " dist/index.js" ,
55 "types" : " dist/index.d.ts" ,
66 "description" : " Node wrapper for nerdctl" ,
Original file line number Diff line number Diff line change @@ -69,12 +69,9 @@ export default abstract class BaseBackend {
6969 abstract login (
7070 flags ?: LoginCommandFlags ,
7171 server ?: string
72- ) : Promise < ExecResult > ;
72+ ) : Promise < ShellString > ;
7373
74- abstract run (
75- image : string ,
76- flags ?: RunCommandFlags
77- ) : Promise < ExecResult | string > ;
74+ abstract run ( image : string , flags ?: RunCommandFlags ) : Promise < ChildProcess > ;
7875
7976 abstract stop (
8077 container : string | string [ ] ,
Original file line number Diff line number Diff line change @@ -18,34 +18,22 @@ export default class LimaBackend extends BaseBackend {
1818 async start ( ) : Promise < void > { }
1919
2020 //#region registry
21- async login ( flags ?: LoginCommandFlags , server ?: string ) : Promise < ExecResult > {
21+ async login (
22+ flags ?: LoginCommandFlags ,
23+ server ?: string
24+ ) : Promise < ShellString > {
2225 const command = `${ this . container } login ${ this . mergeFlags (
2326 flags
2427 ) } ${ server } `;
2528
26- return await this . exec ( command , { async : false } ) ;
29+ return ( await this . exec ( command , { async : false } ) ) as ShellString ;
2730 }
2831 //#endregion
2932
3033 //#region containers
31- async run (
32- image : string ,
33- flags ?: RunCommandFlags
34- ) : Promise < ExecResult | string > {
34+ async run ( image : string , flags ?: RunCommandFlags ) : Promise < ChildProcess > {
3535 const command = `${ this . container } run ${ this . mergeFlags ( flags ) } ${ image } ` ;
36-
37- if ( ! flags ?. detach ) {
38- return await this . exec ( command , { async : false } ) ;
39- }
40-
41- const child = ( await this . exec ( command ) ) as ChildProcess ;
42-
43- return new Promise ( ( resove , reject ) => {
44- child . stdout ! . on ( "data" , ( data ) => {
45- if ( ! data ) reject ( "" ) ;
46- resove ( data ) ;
47- } ) ;
48- } ) ;
36+ return ( await this . exec ( command ) ) as ChildProcess ;
4937 }
5038
5139 async stop (
You can’t perform that action at this time.
0 commit comments