File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,9 @@ function build(args: BuildArgs): void {
138138
139139 run ( `react-scripts build && cp -r i18n icon.png build` ) ;
140140 run ( `d2-manifest package.json build/manifest.webapp -t ${ manifestType } -n '${ variant . title } '` ) ;
141+ if ( variant . file === "metadata-synchronization" ) {
142+ updateManifestJsonFile ( `build/manifest.json` , variant . title ) ;
143+ }
141144 updateManifestNamespace ( `build/manifest.webapp` , variant . file ) ;
142145 run ( `rm -f ${ fileName } ` ) ;
143146 run ( `cd build && zip -r ../${ fileName } *` ) ;
@@ -153,6 +156,14 @@ function updateManifestNamespace(manifestPath: string, variantFile: string) {
153156 }
154157}
155158
159+ function updateManifestJsonFile ( manifestJsonPath : string , variantTitle : string ) {
160+ if ( fs . existsSync ( manifestJsonPath ) ) {
161+ const manifestJson = JSON . parse ( fs . readFileSync ( manifestJsonPath , "utf8" ) ) ;
162+ Object . assign ( manifestJson , { name : variantTitle , short_name : variantTitle } ) ;
163+ fs . writeFileSync ( manifestJsonPath , JSON . stringify ( manifestJson , null , 2 ) ) ;
164+ }
165+ }
166+
156167/* Start server */
157168
158169type StartServerArgs = { variant : string ; port : number ; verbose : boolean } ;
You can’t perform that action at this time.
0 commit comments