Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
No EOL
499 B
Text
18 lines
No EOL
499 B
Text
import { unlinkSync, writeFileSync } from 'fs';
|
|
import { renameSync } from './rename';
|
|
export function writeFileAtomic(filePath, content) {
|
|
const tempPath = filePath + '.tmp.' + Math.random().toString(36).slice(2);
|
|
try {
|
|
writeFileSync(tempPath, content, 'utf-8');
|
|
renameSync(tempPath, filePath);
|
|
} catch (e) {
|
|
try {
|
|
unlinkSync(tempPath);
|
|
} catch {
|
|
// ignore
|
|
}
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
//# sourceMappingURL=write-atomic.js.map |