getprismo 0.1.45 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/prismo-dev-scan.js +7 -0
- package/package.json +1 -1
package/lib/prismo-dev-scan.js
CHANGED
|
@@ -178,6 +178,13 @@ const { appendIgnoreSuggestions, applyFixes } = require("./prismo-dev/fixes")({
|
|
|
178
178
|
function writeGeneratedFile(root, relPath, contents) {
|
|
179
179
|
const fullPath = path.join(root, relPath);
|
|
180
180
|
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
|
181
|
+
// Periodic regenerations (connector auto-detect every few minutes) must
|
|
182
|
+
// not churn backups when nothing changed.
|
|
183
|
+
try {
|
|
184
|
+
if (fs.existsSync(fullPath) && fs.readFileSync(fullPath, "utf8") === contents) {
|
|
185
|
+
return { path: relPath, backupPath: null, unchanged: true };
|
|
186
|
+
}
|
|
187
|
+
} catch {}
|
|
181
188
|
const backupPath = backupIfExists(fullPath);
|
|
182
189
|
fs.writeFileSync(fullPath, contents, "utf8");
|
|
183
190
|
return { path: relPath, backupPath };
|
package/package.json
CHANGED