This commit is contained in:
Benjamin Toby
2025-07-21 13:51:59 +01:00
parent 5de4d1dc73
commit 822778d43b
39 changed files with 944 additions and 421 deletions
+18
View File
@@ -0,0 +1,18 @@
import fs from "fs";
import grabDirNames from "./grab-dir-names";
import { SyncFileConfig } from "../types";
export default function getSyncConfig(): SyncFileConfig {
try {
const { syncConfigFilePath } = grabDirNames();
if (!fs.existsSync(syncConfigFilePath)) {
fs.writeFileSync(syncConfigFilePath, JSON.stringify({}), "utf-8");
return {};
}
const syncConfigJSON = fs.readFileSync(syncConfigFilePath, "utf-8");
return JSON.parse(syncConfigJSON);
} catch (error) {
return { status: "error" };
}
}