@@ -25,7 +25,7 @@ const copyArrayFiles = async (dirName, files, name, type) => {
2525 const folderName = dirName === '/' ? '/' : `/${ dirName } /` ;
2626
2727 if ( existsSync ( `node_modules/${ name } ${ folderName } ${ file } ` ) ) {
28- promises . push ( copy ( `node_modules/${ name } ${ folderName } ${ file } ` , `media/vendor/${ name . replace ( / .+ \/ / , '' ) } ${ type ? `/${ type } ` : '' } /${ file } ` ) ) ;
28+ promises . push ( copy ( `node_modules/${ name } ${ folderName } ${ file } ` , `media/vendor/${ name . replace ( / .+ \/ / , '' ) } ${ type ? `/${ type } ` : '' } /${ file } ` , { preserveTimestamps : true } ) ) ;
2929 }
3030 }
3131
@@ -39,13 +39,13 @@ module.exports.tinyMCE = async (packageName, version) => {
3939 const itemvendorPath = join ( RootPath , `media/vendor/${ packageName } ` ) ;
4040
4141 if ( ! await existsSync ( itemvendorPath ) ) {
42- await mkdir ( itemvendorPath ) ;
43- await mkdir ( join ( itemvendorPath , 'icons' ) ) ;
44- await mkdir ( join ( itemvendorPath , 'plugins' ) ) ;
45- await mkdir ( join ( itemvendorPath , 'langs' ) ) ;
46- await mkdir ( join ( itemvendorPath , 'skins' ) ) ;
47- await mkdir ( join ( itemvendorPath , 'themes' ) ) ;
48- await mkdir ( join ( itemvendorPath , 'templates' ) ) ;
42+ await mkdir ( itemvendorPath , { mode : 0o755 } ) ;
43+ await mkdir ( join ( itemvendorPath , 'icons' ) , { mode : 0o755 } ) ;
44+ await mkdir ( join ( itemvendorPath , 'plugins' ) , { mode : 0o755 } ) ;
45+ await mkdir ( join ( itemvendorPath , 'langs' ) , { mode : 0o755 } ) ;
46+ await mkdir ( join ( itemvendorPath , 'skins' ) , { mode : 0o755 } ) ;
47+ await mkdir ( join ( itemvendorPath , 'themes' ) , { mode : 0o755 } ) ;
48+ await mkdir ( join ( itemvendorPath , 'templates' ) , { mode : 0o755 } ) ;
4949 }
5050
5151 await copyAllFiles ( 'icons' , 'tinymce' , 'icons' ) ;
@@ -58,13 +58,13 @@ module.exports.tinyMCE = async (packageName, version) => {
5858 // Update the XML file for tinyMCE
5959 let tinyXml = await readFile ( `${ RootPath } /plugins/editors/tinymce/tinymce.xml` , { encoding : 'utf8' } ) ;
6060 tinyXml = tinyXml . replace ( xmlVersionStr , `$1${ version } $3` ) ;
61- await writeFile ( `${ RootPath } /plugins/editors/tinymce/tinymce.xml` , tinyXml , { encoding : 'utf8' } ) ;
61+ await writeFile ( `${ RootPath } /plugins/editors/tinymce/tinymce.xml` , tinyXml , { encoding : 'utf8' , mode : 0o644 } ) ;
6262
6363 // Remove that sourcemap...
6464 let tinyWrongMap = await readFile ( `${ RootPath } /media/vendor/tinymce/skins/ui/oxide/skin.min.css` , { encoding : 'utf8' } ) ;
6565 tinyWrongMap = tinyWrongMap . replace ( '/*# sourceMappingURL=skin.min.css.map */' , '' ) ;
66- await writeFile ( `${ RootPath } /media/vendor/tinymce/skins/ui/oxide/skin.min.css` , tinyWrongMap , { encoding : 'utf8' } ) ;
66+ await writeFile ( `${ RootPath } /media/vendor/tinymce/skins/ui/oxide/skin.min.css` , tinyWrongMap , { encoding : 'utf8' , mode : 0o644 } ) ;
6767
6868 // Restore our code on the vendor folders
69- await copy ( join ( RootPath , 'build/media_source/vendor/tinymce/templates' ) , join ( RootPath , 'media/vendor/tinymce/templates' ) ) ;
69+ await copy ( join ( RootPath , 'build/media_source/vendor/tinymce/templates' ) , join ( RootPath , 'media/vendor/tinymce/templates' ) , { preserveTimestamps : true } ) ;
7070} ;
0 commit comments