diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-08-25 00:44:13 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-08-25 00:44:13 +1000 |
commit | 314a4787ce55a091cb89ef4281d7ba09e8323fa4 (patch) | |
tree | d77142c009e9c6d45390a8fe01c9aee966d7a4cc /scripts/depcheck.js | |
parent | Merge remote-tracking branch 'upstream/staging' into feat/captchaVerify (diff) | |
parent | case insensitive header for rate limits, fix rate limit default settings (diff) | |
download | server-314a4787ce55a091cb89ef4281d7ba09e8323fa4.tar.xz |
Merge remote-tracking branch 'upstream/staging' into feat/captchaVerify
Diffstat (limited to 'scripts/depcheck.js')
-rw-r--r-- | scripts/depcheck.js | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/scripts/depcheck.js b/scripts/depcheck.js index 08df156c..44ac2bb6 100644 --- a/scripts/depcheck.js +++ b/scripts/depcheck.js @@ -9,22 +9,22 @@ const { execIn, getLines } = require("./utils"); let npmi_extra_flags = ""; const resolveminor = argv.includes("resolveminor"); -if(argv.includes("nobuild")) npmi_extra_flags += "--ignore-scripts "; +if (argv.includes("nobuild")) npmi_extra_flags += "--ignore-scripts "; parts.forEach((part) => { let partDir = path.join(__dirname, "..", "..", part); let distDir = path.join(partDir, "dist"); console.log(`Checking updates for ${part} (${partDir})`); - if(part == "bundle") { - execIn(`npm run syncdeps`, partDir) + if (part == "bundle") { + execIn(`npm run syncdeps`, partDir); } - if(resolveminor) { - fs.rmSync(path.join(partDir, "node_modules"), { + if (resolveminor) { + fs.rmSync(path.join(partDir, "node_modules"), { recursive: true, - force: true, + force: true }); - execIn(`npm i --save --no-fund --no-audit --no-package-lock ${npmi_extra_flags}`, partDir) - } + execIn(`npm i --save --no-fund --no-audit --no-package-lock ${npmi_extra_flags}`, partDir); + } let x = [ [ "pkg", @@ -33,24 +33,18 @@ parts.forEach((part) => { wanted: "2.0", latest: "2.0", dependent: "cdn", - location: "/usr/src/fosscord/bundle/node_packages/pkg", - }, - ], + location: "/usr/src/fosscord/bundle/node_packages/pkg" + } + ] ]; - x = Object.entries( - JSON.parse(execIn("npm outdated --json", partDir)) - ); + x = Object.entries(JSON.parse(execIn("npm outdated --json", partDir))); x.forEach((a) => { - let pkgname = a[0]; - let pkginfo = a[1]; - if(!pkginfo.current) - console.log(`MISSING ${pkgname}: ${pkginfo.current} -> ${pkginfo.wanted} (latest: ${pkginfo.latest})`); - else if(pkginfo.latest != pkginfo.wanted){ - if(pkginfo.current != pkginfo.wanted) - console.log(`MINOR ${pkgname}: ${pkginfo.current} -> ${pkginfo.wanted}`); - console.log(`MAJOR ${pkgname}: ${pkginfo.current} -> ${pkginfo.latest}`); - } - else - console.log(`MINOR ${pkgname}: ${pkginfo.current} -> ${pkginfo.wanted}`); + let pkgname = a[0]; + let pkginfo = a[1]; + if (!pkginfo.current) console.log(`MISSING ${pkgname}: ${pkginfo.current} -> ${pkginfo.wanted} (latest: ${pkginfo.latest})`); + else if (pkginfo.latest != pkginfo.wanted) { + if (pkginfo.current != pkginfo.wanted) console.log(`MINOR ${pkgname}: ${pkginfo.current} -> ${pkginfo.wanted}`); + console.log(`MAJOR ${pkgname}: ${pkginfo.current} -> ${pkginfo.latest}`); + } else console.log(`MINOR ${pkgname}: ${pkginfo.current} -> ${pkginfo.wanted}`); }); }); |