mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Refactor Git to accept a nostr object
This commit is contained in:
16 files changed
+184
-379
No files matched your search
@@ -1,8 +1,7 @@
|
||||
import { Buffer } from 'buffer';
|
||||
import { Git } from '@/lib/git';
|
||||
import type { Git } from '@/lib/git';
|
||||
import type { JSRuntimeFS } from '@/lib/JSRuntime';
|
||||
|
||||
|
||||
// Polyfill Buffer for browser
|
||||
if (typeof window !== 'undefined') {
|
||||
(window as { Buffer?: typeof Buffer }).Buffer = Buffer;
|
||||
@@ -18,14 +17,19 @@ export interface Project {
|
||||
lastModified: Date;
|
||||
}
|
||||
|
||||
export interface ProjectsManagerOptions {
|
||||
fs: JSRuntimeFS;
|
||||
git: Git;
|
||||
}
|
||||
|
||||
export class ProjectsManager {
|
||||
fs: JSRuntimeFS;
|
||||
git: Git;
|
||||
dir: string;
|
||||
|
||||
constructor(fs: JSRuntimeFS) {
|
||||
this.fs = fs;
|
||||
this.git = new Git(fs, 'https://cors.isomorphic-git.org');
|
||||
constructor(options: ProjectsManagerOptions) {
|
||||
this.fs = options.fs;
|
||||
this.git = options.git;
|
||||
this.dir = '/projects';
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user