UNPKG

autoheal

Version:

GPT Test driven development. Automatically fix tests and guide GPT to write and fix code using your tests.

19 lines (15 loc) 402 B
import fs from "fs"; export function backupFile(path: string) { const backupPath = `${path}.ahbackup`; fs.copyFileSync(path, backupPath); return backupPath; } export function restoreFile(path: string) { const backupPath = `${path}.ahbackup`; fs.copyFileSync(backupPath, path); } export function restortAllFiles(paths: string[]) { paths.forEach((path) => { restoreFile(path); }); }