Skip to content

Instantly share code, notes, and snippets.

@nodew
Created February 11, 2020 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nodew/2e8dc022fb97b9bdc2156c7f6ec32e84 to your computer and use it in GitHub Desktop.
Save nodew/2e8dc022fb97b9bdc2156c7f6ec32e84 to your computer and use it in GitHub Desktop.
clone all d3 packages to local dev box
const fs = require("fs");
const path = require("path");
const cp = require("child_process");
const clone = (package) => {
if (!fs.existsSync(package)) {
console.log(`Start to clone ${package}`);
cp.execSync(`git clone https://github.com/d3/${package}.git --depth=1`);
}
}
clone("d3");
const packageFile = fs.readFileSync(path.join(__dirname, "d3", "package.json"), { encoding: "utf8" });
if (packageFile) {
dependencies = (JSON.parse(packageFile)).dependencies;
packages = Object.keys(dependencies);
packages.forEach(package => {
clone(package);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment