Skip to content

Commit bca0a71

Browse files
committed
Revert "Fix #414"
This reverts commit b211b6e.
1 parent 0215646 commit bca0a71

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

src/utils/layout-helpers.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as memoize from 'memoizee';
22
import * as path from 'path';
3-
import * as childProcess from 'child_process';
43
import { CompletionItem, CompletionItemKind } from 'vscode-languageserver/node';
54
import { addToRegistry, normalizeMatchNaming } from './registry-api';
65
import { clean, coerce, valid } from 'semver';
@@ -120,26 +119,10 @@ export function getPodModulePrefix(root: string): string | null {
120119
return podModulePrefix.trim().length > 0 ? podModulePrefix : null;
121120
}
122121

123-
function getRoot(fromDir: string) {
124-
try {
125-
const topLevel = childProcess.execSync('git rev-parse --show-toplevel', { encoding: 'utf8', cwd: fromDir });
126-
127-
return topLevel.trim();
128-
} catch {
129-
// we ignore the error, because we might not be in a git repo
130-
return '/';
131-
}
132-
}
133-
134122
export async function resolvePackageRoot(root: string, addonName: string, packagesFolder = 'node_modules'): Promise<string | false> {
135123
const roots = root.split(path.sep);
136-
const stopAt = getRoot(root);
137124

138125
while (roots.length) {
139-
if (roots.join(path.sep) === stopAt) {
140-
return false;
141-
}
142-
143126
const prefix = roots.join(path.sep);
144127
const maybePath = path.join(prefix, packagesFolder, addonName);
145128
const linkedPath = path.join(prefix, addonName);

0 commit comments

Comments
 (0)