@@ -79,11 +79,14 @@ const build_src = gulp.series(
7979
8080function build_xpi_official_release_impl ( ) {
8181 const final_install_rdf_path = "./src/install.rdf"
82+ const final_install_rdf_path_in_build_path = `${ build_path } /install.rdf`
8283 const product_path = "./product"
8384 const product_ext = ".xpi"
85+ let final_install_rdf_content = ""
8486
8587 return fs . readFile ( final_install_rdf_path , { encoding : "utf8" } )
8688 . then ( function ( content ) {
89+ final_install_rdf_content = content
8790 const matchData = / < e m : v e r s i o n > ( .+ ) < \/ e m : v e r s i o n > / i. exec ( content )
8891 return matchData [ 1 ]
8992 } )
@@ -92,16 +95,25 @@ function build_xpi_official_release_impl() {
9295 throw new Error ( "Something is wrong, version is nil" )
9396 }
9497
98+ let new_final_install_rdf_content = final_install_rdf_content
9599 let product_filename = `tabkit2_${ version_string } `
96100
101+ let sometimesWriteFilePromise = Promise . resolve ( )
97102 if ( fileExists . sync ( `${ product_path } /${ product_filename } ${ product_ext } ` ) ) {
98103 let now = new Date ( )
99104 product_filename = `${ product_filename } -${ dateFormat ( now , "yyyy-mm-dd-hhMMss" ) } `
105+ new_final_install_rdf_content = final_install_rdf_content . replace (
106+ / ( < e m : v e r s i o n > ) ( .+ ) ( < \/ e m : v e r s i o n > ) / i,
107+ `$1$2.dev.${ dateFormat ( now , "yyyy-mm-dd-hhMMss" ) } $3` ,
108+ )
109+ sometimesWriteFilePromise = fs . writeFile ( final_install_rdf_path_in_build_path , new_final_install_rdf_content , { encoding : "utf8" } )
100110 }
101111
102- return gulp . src ( `${ build_path } /**/*` )
103- . pipe ( zip ( `${ product_filename } ${ product_ext } ` ) )
104- . pipe ( gulp . dest ( product_path ) )
112+ return sometimesWriteFilePromise . then ( ( ) => {
113+ return gulp . src ( `${ build_path } /**/*` )
114+ . pipe ( zip ( `${ product_filename } ${ product_ext } ` ) )
115+ . pipe ( gulp . dest ( product_path ) )
116+ } )
105117 } )
106118}
107119
0 commit comments