@naturalcycles/dev-lib 20.31.0 → 20.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/check.util.js +3 -3
- package/package.json +1 -1
package/dist/check.util.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
|
-
import {
|
|
3
|
+
import { findPackageJSON } from 'node:module';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { _isTruthy } from '@naturalcycles/js-lib';
|
|
6
6
|
import { _uniq } from '@naturalcycles/js-lib/array';
|
|
@@ -525,9 +525,9 @@ function hasDependencyInNodeModules(name) {
|
|
|
525
525
|
// })
|
|
526
526
|
// } catch {}
|
|
527
527
|
// }
|
|
528
|
-
const require = createRequire(import.meta.url);
|
|
529
528
|
export function findPackageBinPath(pkg, cmd) {
|
|
530
|
-
const packageJsonPath =
|
|
529
|
+
const packageJsonPath = findPackageJSON(pkg, import.meta.url);
|
|
530
|
+
_assert(packageJsonPath, `Could not find package.json for ${pkg}`);
|
|
531
531
|
const { bin } = fs2.readJson(packageJsonPath);
|
|
532
532
|
return path.join(path.dirname(packageJsonPath), typeof bin === 'string' ? bin : bin[cmd]);
|
|
533
533
|
}
|