Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
chore(setup): skip unchanged config writes
Richie McIlroyfc7a07492463
diff --git a/apps/desktop/scripts/prepare.js b/apps/desktop/scripts/prepare.jsindex 68a5ac887..05cc27d40 100644--- a/apps/desktop/scripts/prepare.js+++ b/apps/desktop/scripts/prepare.js@@ -112,7 +112,7 @@ export async function createTauriPlatformConfigs(const mergedConfig = configOptions? deepMerge(baseConfig, configOptions): baseConfig;- await fs.writeFile(+ await writeFileIfChanged(`${srcTauri}/${configFileName}`,JSON.stringify(mergedConfig, null, 2),);@@ -129,3 +129,11 @@ main().catch((err) => {console.error(err);console.error("---");});++async function writeFileIfChanged(filePath, contents) {+ const currentContents = await fs+ .readFile(filePath, "utf-8")+ .catch(() => undefined);++ if (currentContents !== contents) await fs.writeFile(filePath, contents);+}diff --git a/scripts/setup.js b/scripts/setup.jsindex a9fd6c393..0a2b3b2ca 100644--- a/scripts/setup.js+++ b/scripts/setup.js@@ -193,7 +193,7 @@ async function main() {}await fs.mkdir(path.join(__root, ".cargo"), { recursive: true });- await fs.writeFile(+ await writeFileIfChanged(path.join(__root, ".cargo/config.toml"),cargoConfigContents + cargoBuildContents,);@@ -319,6 +319,14 @@ async function setupMacOSOnnxRuntime() {return outputPath;}+async function writeFileIfChanged(filePath, contents) {+ const currentContents = await fs+ .readFile(filePath, "utf-8")+ .catch(() => undefined);++ if (currentContents !== contents) await fs.writeFile(filePath, contents);+}+async function signMacOSDylib(filePath) {const signId = env.APPLE_SIGNING_IDENTITY || "-";const keychain = env.APPLE_KEYCHAIN ? `--keychain ${env.APPLE_KEYCHAIN}` : "";