File tree Expand file tree Collapse file tree 2 files changed +26
-11
lines changed
Expand file tree Collapse file tree 2 files changed +26
-11
lines changed Original file line number Diff line number Diff line change @@ -66,24 +66,30 @@ const internalFs = {
6666 reject ( "udata is null" ) ;
6767 }
6868
69- let data ;
69+ let options = {
70+ path : filename ,
71+ recursive : create ,
72+ } ;
73+
74+ reject = setMessage ( reject ) ;
75+
7076 if (
7177 udata instanceof ArrayBuffer ||
7278 Object . prototype . toString . call ( udata ) === "[object ArrayBuffer]"
7379 ) {
74- const decoder = new TextDecoder ( "utf-8" ) ;
75- data = decoder . decode ( udata ) ;
80+ // Binary data — store as base64
81+ options . data = btoa ( String . fromCharCode ( ...new Uint8Array ( udata ) ) ) ;
82+ options . encoding = Encoding . BASE64 ;
83+ } else if ( typeof udata === "string" ) {
84+ // Text data — store as UTF-8
85+ options . data = udata ;
86+ options . encoding = Encoding . UTF8 ;
7687 } else {
77- data = udata ;
88+ reject ( "Unsupported udata type" ) ;
89+ return ;
7890 }
7991
80- reject = setMessage ( reject ) ;
81- Filesystem . writeFile ( {
82- path : filename ,
83- data : data ,
84- encoding : Encoding . UTF8 ,
85- recursive : create ,
86- } )
92+ Filesystem . writeFile ( options )
8793 . then ( ( file ) => {
8894 console . log (
8995 `Successfully written into (name: ${ name } ) ${ filename } file` ,
Original file line number Diff line number Diff line change @@ -75,10 +75,19 @@ export default async function PluginInclude(
7575 const installedPlugin = await fsOperation (
7676 Url . join ( PLUGIN_DIR , id , "plugin.json" ) ,
7777 ) . readFile ( "json" ) ;
78+
79+ console . log ( installPlugin ) ;
80+
7881 const { author } = installedPlugin ;
82+
83+ console . log ( author ) ;
84+
7985 const description = await fsOperation (
8086 Url . join ( PLUGIN_DIR , id , installedPlugin . readme ) ,
8187 ) . readFile ( "utf8" ) ;
88+
89+ console . log ( description ) ;
90+
8291 let changelogs = "" ;
8392 if ( installedPlugin . changelogs ) {
8493 const changelogPath = Url . join (
You can’t perform that action at this time.
0 commit comments