autoheal
Version:
GPT Test driven development. Automatically fix tests and guide GPT to write and fix code using your tests.
16 lines (15 loc) • 391 B
JavaScript
import fs from "fs";
export function backupFile(path) {
const backupPath = `${path}.ahbackup`;
fs.copyFileSync(path, backupPath);
return backupPath;
}
export function restoreFile(path) {
const backupPath = `${path}.ahbackup`;
fs.copyFileSync(backupPath, path);
}
export function restortAllFiles(paths) {
paths.forEach((path) => {
restoreFile(path);
});
}