@@ -10,14 +10,13 @@ const flags = args.filter((value) => value.startsWith("--"));
1010
1111const optionalFlag = ( flag ) => ( flags . includes ( flag ) ? flag : "" ) ;
1212
13- function getFlagContents ( flag , replacement ) {
14- const indexOf = flags . indexOf ( flag )
15- const nextArg = args [ indexOf + 1 ]
16- if ( indexOf != - 1 && nextArg ) {
17- return nextArg
18- } else {
19- return replacement
13+ function getFlagContents ( flag , replacement ) {
14+ const indexOf = flags . indexOf ( flag ) ;
15+ const nextArg = args [ indexOf + 1 ] ;
16+ if ( indexOf !== - 1 && nextArg ) {
17+ return nextArg ;
2018 }
19+ return replacement ;
2120}
2221
2322function buildImage ( image ) {
@@ -34,15 +33,23 @@ function buildImage(image) {
3433 "." ,
3534 "-f" ,
3635 `${ image } /Dockerfile` ,
37- optionalFlag ( "--quiet" ) ,
36+ `--progress= ${ argv . includes ( "--quiet" ) ? "quiet" : "plain" } ` ,
3837 optionalFlag ( "--push" ) ,
3938 multiPlatformBuild ? "--platform" : "" ,
4039 multiPlatformBuild ? platforms : "" ,
4140 "--tag" ,
4241 `ghcr.io/spaceness/${ image } ` ,
4342 ] ,
44- { stdio : "inherit" , shell : true } ,
43+ { stdio : [ "inherit" , "pipe" , "pipe" ] , shell : true } ,
4544 ) ;
45+
46+ process . stdout . on ( "data" , ( data ) => {
47+ globalThis . process . stdout . write ( `${ image } : ${ data } ` ) ;
48+ } ) ;
49+
50+ process . stderr . on ( "data" , ( data ) => {
51+ globalThis . process . stderr . write ( `${ image } : ${ data } ` ) ;
52+ } ) ;
4653 process . on ( "close" , ( code ) => {
4754 if ( code === 0 ) {
4855 resolve ( 0 ) ;
@@ -60,12 +67,12 @@ function buildImage(image) {
6067}
6168
6269try {
63- let images = getFlagContents ( "--images" , undefined )
70+ let images = getFlagContents ( "--images" , undefined ) ;
6471
6572 if ( images ) {
66- images = images . split ( ',' )
73+ images = images . split ( "," ) ;
6774 } else {
68- images = defaultImages
75+ images = defaultImages ;
6976 }
7077
7178 await Promise . all ( images . map ( buildImage ) ) ;
0 commit comments