File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55const fs = new LightningFS ( 'feathernote-fs' ) ;
66const pfs = fs . promises ;
77
8- // Setup Git plugin
9- // We rely on window.git and window.GitHttp being available from loaded libs
10- if ( window . git && window . GitHttp ) {
11- git . plugins . set ( 'fs' , fs ) ;
12- git . plugins . set ( 'http' , window . GitHttp ) ;
13- }
8+ // Note: isomorphic-git v1.x does not use git.plugins.set('fs', ...) or 'http'.
9+ // Instead, we pass 'fs' and 'http' in the options object for each command.
1410
1511const GIT_DIR = '/repo' ;
1612
1713// Helper to get git config object
1814const getGitConfig = ( creds ) => {
19- return {
15+ const config = {
2016 fs,
2117 dir : GIT_DIR ,
2218 corsProxy : creds . corsProxy || 'https://cors.isomorphic-git.org' ,
@@ -27,6 +23,11 @@ const getGitConfig = (creds) => {
2723 email : creds . email || 'user@feathernote.app' ,
2824 } ,
2925 } ;
26+
27+ if ( window . GitHttp ) {
28+ config . http = window . GitHttp ;
29+ }
30+ return config ;
3031} ;
3132
3233// Helper to parse Frontmatter
@@ -228,4 +229,4 @@ window.finishGitSync = async (creds) => {
228229 console . error ( 'Git Commit/Push Error:' , e ) ;
229230 }
230231 }
231- } ;
232+ } ;
Original file line number Diff line number Diff line change @@ -517,10 +517,10 @@ <h4 class="font-semibold text-sm" x-text="toast.title"></h4>
517517
518518< link rel ="stylesheet " href ="/index.css?v=___VERSION___ "/>
519519
520- < script defer src ="/libs/isomorphic-git.min.js "> </ script >
521- < script defer src ="/libs/lightning-fs.min.js "> </ script >
522- < script defer src ="/libs/http.min.js "> </ script >
523- <!-- < script src="/src/ git.js?v=___VERSION___"></script> -- >
520+ < script src ="/libs/isomorphic-git.min.js "> </ script >
521+ < script src ="/libs/lightning-fs.min.js "> </ script >
522+ < script src ="/libs/http.min.js "> </ script >
523+ < script src ="/git.js?v=___VERSION___ "> </ script >
524524
525525< script src ="/s3.js?v=___VERSION___ "> </ script >
526526< script src ="/nostr.js?v=___VERSION___ "> </ script >
You can’t perform that action at this time.
0 commit comments