@baqhub/cli
Version:
The official command line interface for the BAQ federated app platform.
18 lines (17 loc) • 836 B
JavaScript
import * as path from "node:path";
import { ProgramError, handleErrors } from "../helpers/error.js";
import { tryFindProfileFile } from "../services/files/profileFile.js";
import { tryFindProjectFile } from "../services/files/projectFile.js";
import { restoreProject } from "../services/restore.js";
export async function restoreCommand(program) {
await handleErrors(program, async () => {
const projectFile = await tryFindProjectFile(path.resolve("."));
if (!projectFile) {
throw new ProgramError("This is not a valid BAQ project.");
}
console.log("Restoring...");
const profileFile = await tryFindProfileFile(path.resolve("."));
await restoreProject(projectFile, profileFile);
console.log("Project restored!");
}, "Something went wrong while restoring.");
}