Setting filepath on config makes it dirty

This commit is contained in:
Cooldude2606 committed 2026-07-10 22:00:42 +01:00
1 parent 9ec12ac7d7
commit 15781bb038
2 files changed
+32 -1

No files matched your search

+10 -1
View File
@@ -251,7 +251,7 @@ export class Config<
constructor(
public location: ConfigLocation,
fields?: Static<typeof Config.jsonSchema>,
public filepath?: string,
private _filepath?: string,
) {
if (typeof location !== "string") {
throw new Error("location must be a string");
@@ -273,6 +273,15 @@ export class Config<
}
}
get filepath() {
return this._filepath;
}
set filepath(filepath: string | undefined) {
this.dirty = true;
this._filepath = filepath;
}
/** A staging version of the config with changes tracked, invalided by revertStaging */
private _staging?: { config: Config<Fields>, changes: Set<string>};