mirror of
https://github.com/thelounge/thelounge
synced 2024-11-11 15:07:14 +00:00
Use require.resolve for yarn
This commit is contained in:
parent
f49bf19023
commit
c870545b46
1 changed files with 1 additions and 19 deletions
|
@ -108,25 +108,7 @@ class Utils {
|
|||
}
|
||||
|
||||
static executeYarnCommand(command, ...parameters) {
|
||||
// First off, try to find yarn inside of The Lounge
|
||||
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 yarn = require.resolve("yarn/bin/yarn.js");
|
||||
const packagesPath = Helper.getPackagesPath();
|
||||
const cachePath = path.join(packagesPath, "package_manager_cache");
|
||||
|
||||
|
|
Loading…
Reference in a new issue