16 lines
663 B
TypeScript
16 lines
663 B
TypeScript
import { getV1Cids } from "../src/downloader.ts";
|
|
import { mainRepos, packageRepos, sitesENS, sourcesDomain } from "../src/contstants.ts";
|
|
import { execSync } from "child_process";
|
|
|
|
const ensDomains = [...Object.values(mainRepos), ...Object.values(packageRepos), ...sitesENS, sourcesDomain];
|
|
const ipfsCids = await getV1Cids(ensDomains.reduce((acc, dom) => Object.assign(acc, { [dom]: dom }), {}));
|
|
for (const [domain, cid] of Object.entries(ipfsCids)) {
|
|
try {
|
|
execSync(`ipfs pin add ${cid}`);
|
|
} catch (e) {
|
|
console.error(`Cannot pin ipfs content by cid ${cid} for domain ${domain}`);
|
|
}
|
|
}
|
|
|
|
console.log("IPFS cids successfully added");
|