@milkmaccya2/hostswitch
Version:
A simple CLI tool to manage and switch between multiple hosts file profiles for different development environments
24 lines • 718 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BackupManager = void 0;
class BackupManager {
fileSystem;
config;
constructor(fileSystem, config) {
this.fileSystem = fileSystem;
this.config = config;
}
backupHosts() {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
const backupPath = `${this.config.backupDir}/hosts_${timestamp}`;
try {
this.fileSystem.copySync(this.config.hostsPath, backupPath);
return backupPath;
}
catch (_err) {
return undefined;
}
}
}
exports.BackupManager = BackupManager;
//# sourceMappingURL=BackupManager.js.map