Skip to content

Commit

Permalink
Drop the findup-sync dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mgol committed Nov 14, 2023
1 parent 10ac9c5 commit 091279a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 129 deletions.
17 changes: 16 additions & 1 deletion lib/check-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,26 @@
const fs = require('fs');
const path = require('path');
const pico = require('picocolors');
const findup = require('findup-sync');
const semver = require('semver');
const spawn = require('child_process').spawn;
const spawnSync = require('child_process').spawnSync;

const findup = fileName => {
let dir = process.cwd();
while (true) {
const filePath = path.resolve(dir, fileName);
if (fs.existsSync(filePath)) {
return filePath;
}
const nextDir = path.dirname(dir);
if (dir === nextDir) {
// top level => not found
return null;
}
dir = nextDir;
}
};

const checkDependenciesHelper = (syncOrAsync, config, callback) => {
// We treat the signature:
// checkDependencies(callback)
Expand Down
137 changes: 10 additions & 127 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"lib"
],
"dependencies": {
"findup-sync": "^5.0.0",
"picocolors": "^1.0.0",
"semver": "^7.5.4"
},
Expand Down

0 comments on commit 091279a

Please sign in to comment.