mirror of https://github.com/MaxLeiter/Drift
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
342 B
JavaScript
16 lines
342 B
JavaScript
'use strict';
|
|
const fs = require('fs');
|
|
const globalDirs = require('global-dirs');
|
|
const isPathInside = require('is-path-inside');
|
|
|
|
module.exports = (() => {
|
|
try {
|
|
return (
|
|
isPathInside(__dirname, globalDirs.yarn.packages) ||
|
|
isPathInside(__dirname, fs.realpathSync(globalDirs.npm.packages))
|
|
);
|
|
} catch {
|
|
return false;
|
|
}
|
|
})();
|