Skip to content

Commit

Permalink
[1.10.3] Fixed journal needing an FS argument
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Feb 13, 2025
1 parent 40323a4 commit 8703532
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/backends/cow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ export class Journal extends EventEmitter<{
update: [op: JournalOperation, path: string];
delete: [path: string];
}> {
public entries: JournalEntry[] = [];

public constructor(public readonly fs: CopyOnWriteFS) {
super();
}
protected entries: JournalEntry[] = [];

public toString(): string {
return journalMagicString + this.entries.map(entry => `${entry.op.padEnd(maxOpLength)} ${entry.path}`).join('\n');
Expand Down Expand Up @@ -134,16 +130,15 @@ export class CopyOnWriteFS extends FileSystem {
await this.writable.ready();
}

public readonly journal: Journal;

public constructor(
/** The file system that initially populates this file system. */
public readonly readable: FileSystem,

/** The file system to write modified files to. */
public readonly writable: FileSystem,

journal?: Journal
/** The journal to use for persisting deletions */
public readonly journal = new Journal()
) {
super(0x62756c6c, readable.name);

Expand All @@ -152,8 +147,6 @@ export class CopyOnWriteFS extends FileSystem {
}

readable.attributes.set('no_write');

this.journal = journal ?? new Journal(this);
}

public isDeleted(path: string): boolean {
Expand Down

0 comments on commit 8703532

Please sign in to comment.