diff --git a/Makefile.mjs b/Makefile.mjs index a82411efb823..567788439db0 100644 --- a/Makefile.mjs +++ b/Makefile.mjs @@ -1,5 +1,5 @@ import "shelljs/make.js"; -import { default as path } from "path"; +import path from "path"; import { execFileSync } from "child_process"; import { writeFileSync } from "fs"; diff --git a/scripts/clone-license.js b/scripts/clone-license.js index fbcd35dce01c..289519fe592a 100644 --- a/scripts/clone-license.js +++ b/scripts/clone-license.js @@ -1,19 +1,25 @@ -import { default as shell } from "shelljs"; +import { readFileSync, writeFileSync } from "fs"; +import shell from "shelljs"; +import path from "path"; console.log("Cloning LICENSE to babel packages"); +const LICENSE = readFileSync("LICENSE", "utf8"); + +console.log(LICENSE); + shell.ls("-d", "./packages/*/").forEach(dir => { if ( !dir.match( /.*packages\/(babel-parser|babel-plugin-transform-object-assign)\/?$/ ) ) { - shell.cp("LICENSE", dir); + writeFileSync(path.join(dir, "LICENSE"), LICENSE); } }); shell.ls("-d", "./eslint/*/").forEach(dir => { if (!dir.match(/.*eslint\/(babel-eslint-plugin)\/?$/)) { - shell.cp("LICENSE", dir); + writeFileSync(path.join(dir, "LICENSE"), LICENSE); } });