@@ -142,13 +142,18 @@ async function gistBackupAction(action, keep, encode) {
142142 let content ;
143143 const settings = $ . read ( SETTINGS_KEY ) ;
144144 const updated = settings . syncTime ;
145+
146+ const encoding = encode || settings . gistUpload || 'base64' ;
147+ $ . info (
148+ `Gist backup action: ${ action } , keep: ${ keep } , encode: ${ encode } , settings encode: ${ settings . gistUpload } , final encoding: ${ encoding } ` ,
149+ ) ;
145150 switch ( action ) {
146151 case 'upload' :
147152 try {
148153 content = $ . read ( '#sub-store' ) ;
149154 content = content ? JSON . parse ( content ) : { } ;
150155 if ( $ . env . isNode ) content = JSON . parse ( JSON . stringify ( $ . cache ) ) ;
151- if ( encode === 'plaintext' ) {
156+ if ( encoding === 'plaintext' ) {
152157 content . settings . gistToken =
153158 '恢复后请重新设置 GitHub Token' ;
154159 content = JSON . stringify ( content , null , ` ` ) ;
@@ -176,7 +181,7 @@ async function gistBackupAction(action, keep, encode) {
176181 content = $ . read ( '#sub-store' ) ;
177182 content = content ? JSON . parse ( content ) : { } ;
178183 if ( $ . env . isNode ) content = JSON . parse ( JSON . stringify ( $ . cache ) ) ;
179- if ( encode === 'plaintext' ) {
184+ if ( encoding === 'plaintext' ) {
180185 content . settings . gistToken = '恢复后请重新设置 GitHub Token' ;
181186 content = JSON . stringify ( content , null , ` ` ) ;
182187 } else {
0 commit comments