@@ -45,7 +45,7 @@ function validateRequiredFields(
4545
4646 if ( missingFields . length > 0 ) {
4747 if ( ! silent ) {
48- console . error ( "\n! Missing required information for POT file header:\n" ) ;
48+ console . error ( "\n⚠️ Missing required information for POT file header:\n" ) ;
4949
5050 for ( const field of missingFields ) {
5151 console . error (
@@ -343,11 +343,13 @@ export function translationsHeaders(args: Args): SetOfBlocks {
343343 // the main file is the plugin main php file or the css file
344344 const fakePath = domain === "plugin" ? `${ args . slug } .php` : "style.css" ;
345345
346- return new SetOfBlocks ( [
347- buildBlock ( `Name of the ${ domain } ` , name , [ fakePath ] ) ,
348- buildBlock ( `Url of the ${ domain } ` , url , [ fakePath ] ) ,
349- buildBlock ( `Description of the ${ domain } ` , description , [ fakePath ] ) ,
350- buildBlock ( `Author of the ${ domain } ` , author , [ fakePath ] ) ,
351- buildBlock ( `Author URI of the ${ domain } ` , authorUri , [ fakePath ] ) ,
352- ] ) ;
346+ const blocks = [ ] ;
347+
348+ if ( name ) blocks . push ( buildBlock ( `Name of the ${ domain } ` , name , [ fakePath ] ) ) ;
349+ if ( url ) blocks . push ( buildBlock ( `Url of the ${ domain } ` , url , [ fakePath ] ) ) ;
350+ if ( description ) blocks . push ( buildBlock ( `Description of the ${ domain } ` , description , [ fakePath ] ) ) ;
351+ if ( author ) blocks . push ( buildBlock ( `Author of the ${ domain } ` , author , [ fakePath ] ) ) ;
352+ if ( authorUri ) blocks . push ( buildBlock ( `Author URI of the ${ domain } ` , authorUri , [ fakePath ] ) ) ;
353+
354+ return new SetOfBlocks ( blocks ) ;
353355}
0 commit comments