Fix bundled @babel/code-frame for test (#19340)
This commit is contained in:
1 parent
2680e80adb
commit
21a8c81940
8 files changed
+48
-57
No files matched your search
Vendored
+17
-6
@@ -4,11 +4,11 @@ const path = require("node:path");
|
||||
const root = path.join(__dirname, "../../");
|
||||
|
||||
function setupVscode() {
|
||||
const settingsFile = path.join(__dirname, "../../.vscode/settings.json");
|
||||
|
||||
const vscodeDirectory = path.join(root, ".vscode/");
|
||||
const settingsFile = path.join(vscodeDirectory, "settings.json");
|
||||
const settingsExampleFile = path.join(
|
||||
__dirname,
|
||||
"../../.vscode/settings.example.json",
|
||||
vscodeDirectory,
|
||||
"settings.example.json",
|
||||
);
|
||||
|
||||
if (fs.existsSync(settingsFile) || !fs.existsSync(settingsExampleFile)) {
|
||||
@@ -29,8 +29,19 @@ module.exports = {
|
||||
name: "plugin-prepare",
|
||||
factory: () => ({
|
||||
hooks: {
|
||||
async afterAllInstalled({ cwd }) {
|
||||
if (cwd !== root) {
|
||||
async afterAllInstalled({ cwd: rawCwd }) {
|
||||
console.log(`Yarn plugin "prepare" running in "${rawCwd}".`);
|
||||
|
||||
let cwd = rawCwd;
|
||||
|
||||
if (process.platform === "win32" && cwd.startsWith("/")) {
|
||||
cwd = cwd.slice(1);
|
||||
}
|
||||
|
||||
if (path.join(cwd, "./") !== root) {
|
||||
console.log(
|
||||
`Yarn plugin "prepare" skipped, yarn command not running in "${root}".`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user