Update index.js

This commit is contained in:
giles 2023-10-23 19:27:51 +00:00
parent 8967e27a44
commit 15c64388df
1 changed files with 312 additions and 307 deletions

View File

@ -261,7 +261,12 @@ const pkg = getPackageJson();
})();
function getPackageJson() {
const pathToPackage = path.join(workspace, 'package.json');
console.log({
pathToPackage,
workspace,
})
if (!existsSync(pathToPackage)) throw new Error("package.json could not be found in your project's root.");
return require(pathToPackage);
}