From d783daa4468f45eea290dec2bb6b8fbefa503e5b Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Thu, 2 Mar 2023 17:29:45 +0100 Subject: [PATCH] fix(ci): add hotfix in built package.json to use proper file patterns in "files" You can read more here: https://github.com/octokit/plugin-retry.js/issues/405 --- scripts/fix-package-json.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 scripts/fix-package-json.js diff --git a/scripts/fix-package-json.js b/scripts/fix-package-json.js new file mode 100644 index 00000000..1a4059b5 --- /dev/null +++ b/scripts/fix-package-json.js @@ -0,0 +1,15 @@ +const fs = require("fs"); +const path = require("path"); +const {EOL} = require("os"); + +const pkgPath = path.join(__dirname, "../pkg/package.json"); +const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8")); + +pkg.files = pkg.files.map((file) => { + if (file.endsWith("/")) { + return file + "**"; + } + return file; +}); + +fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + EOL, "utf8"); \ No newline at end of file