@@ -79,7 +79,7 @@ fs.readdirSync(path.join(__dirname, "file-icons", "devopicons", "svg")).forEach(
7979 svg
8080} ;
8181} ) ;
82- // Get file icons from file-icons/devopicons
82+ // Get file icons from file-icons/mfixx
8383fs . readdirSync ( path . join ( __dirname , "file-icons" , "mfixx" , "svg" ) ) . forEach ( icon => {
8484if ( ! icon . endsWith ( ".svg" ) ) return ;
8585let iconName = icon . toLowerCase ( ) . replace ( ".svg" , "" ) . replace ( "-1" , "" ) ;
@@ -101,6 +101,28 @@ fs.readdirSync(path.join(__dirname, "file-icons", "mfixx", "svg")).forEach(icon
101101 svg
102102} ;
103103} ) ;
104+ // Get file icons from file-icons/bytesize-icons
105+ fs . readdirSync ( path . join ( __dirname , "file-icons" , "bytesize-icons" , "dist" , "icons" ) ) . forEach ( icon => {
106+ if ( ! icon . endsWith ( ".svg" ) ) return ;
107+ let iconName = icon . toLowerCase ( ) . replace ( ".svg" , "" ) ;
108+
109+ let text = fs . readFileSync ( path . join ( __dirname , "file-icons" , "bytesize-icons" , "dist" , "icons" , icon ) , { encoding :"utf8" } ) ;
110+
111+ let dimensions = text . match ( / v i e w B o x = " 0 0 ( \d + ) ( \d + ) " / ) ;
112+ let width = dimensions [ 1 ] ;
113+ let height = dimensions [ 2 ] ;
114+
115+ let svg = text . substr ( text . indexOf ( ">" ) + 1 ) ;
116+ svg = svg . replace ( "</svg>" , "" ) ;
117+
118+ if ( width === null || height === null ) console . log ( icon ) ;
119+
120+ fileIconsObject [ iconName ] = {
121+ width,
122+ height,
123+ svg
124+ } ;
125+ } ) ;
104126// Override with eDEX-specific icons
105127fileIconsObject . showDisks = {
106128width :24 ,
@@ -147,6 +169,7 @@ fileIconsObject.usb = {
147169height :24 ,
148170svg :'<path d="M 14.9994,6.99807L 14.9994,10.9981L 15.9994,10.9981L 15.9994,12.9981L 12.9994,12.9981L 12.9994,4.99807L 14.9994,4.99807L 11.9994,0.998068L 8.9994,4.99807L 10.9994,4.99807L 10.9994,12.9981L 7.9994,12.9981L 7.9994,10.9281C 8.7034,10.5611 9.1994,9.84707 9.1994,8.99807C 9.1994,7.78307 8.2144,6.79807 6.9994,6.79807C 5.7844,6.79807 4.7994,7.78307 4.7994,8.99807C 4.7994,9.84707 5.2954,10.5611 5.9994,10.9281L 5.9994,12.9981C 5.9994,14.1031 6.8934,14.9981 7.9994,14.9981L 10.9994,14.9981L 10.9994,18.0491C 10.2894,18.4141 9.7994,19.1451 9.7994,19.9981C 9.7994,21.2131 10.7844,22.1981 11.9994,22.1981C 13.2144,22.1981 14.1994,21.2131 14.1994,19.9981C 14.1994,19.1451 13.7084,18.4141 12.9994,18.0491L 12.9994,14.9981L 15.9994,14.9981C 17.1044,14.9981 17.9994,14.1031 17.9994,12.9981L 17.9994,10.9981L 18.9994,10.9981L 18.9994,6.99807L 14.9994,6.99807 Z"/>'
149171} ;
172+ fileIconsObject . audio = fileIconsObject . volume ;
150173// Write the file
151174fs . writeFileSync ( path . join ( __dirname , "src" , "assets" , "icons" , "file-icons.json" ) , JSON . stringify ( fileIconsObject , "" , 4 ) ) ;
152175console . log ( "Wrote file-icons.json" ) ;