UNPKG

320 BPlain TextView Raw
1import * as findUp from "find-up";
2import * as path from "path";
3
4export async function findPathToBackfill() {
5 const commandPath = await findUp(path.join("bin", "backfill.js"), {
6 cwd: __dirname
7 });
8 if (!commandPath) {
9 throw new Error("Cannot find path to `backfill` command");
10 }
11
12 return commandPath;
13}