Merge pull request #2993 from thelounge/xpaw/require-resolve-yarn
Use require.resolve for yarn
This commit is contained in:
commit
03c4fc58a3
@ -108,25 +108,7 @@ class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static executeYarnCommand(command, ...parameters) {
|
static executeYarnCommand(command, ...parameters) {
|
||||||
// First off, try to find yarn inside of The Lounge
|
const yarn = require.resolve("yarn/bin/yarn.js");
|
||||||
let yarn = path.join(
|
|
||||||
__dirname, "..", "..", "node_modules",
|
|
||||||
"yarn", "bin", "yarn.js"
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!fs.existsSync(yarn)) {
|
|
||||||
// Now try to find yarn in the same parent folder as The Lounge (flat install)
|
|
||||||
yarn = path.join(
|
|
||||||
__dirname, "..", "..", "..",
|
|
||||||
"yarn", "bin", "yarn.js"
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!fs.existsSync(yarn)) {
|
|
||||||
// Fallback to global installation
|
|
||||||
yarn = "yarn";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const packagesPath = Helper.getPackagesPath();
|
const packagesPath = Helper.getPackagesPath();
|
||||||
const cachePath = path.join(packagesPath, "package_manager_cache");
|
const cachePath = path.join(packagesPath, "package_manager_cache");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user