Skip to content

Commit 682a943

Browse files
committed
add local dir
1 parent a68482c commit 682a943

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

generators/app/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@ function getModuleDir() {
2323

2424
const yarnDir = join(yarnModules(), 'node_modules', 'highlight.js');
2525

26-
if (existsSync(yarnDir)) {
26+
if (existsSync(yarnDir)) {
2727
return yarnDir;
2828
}
2929

30-
throw 'highlight.js not found in global modules';
30+
const localDir = join(__dirname, '..', '..', 'node_modules', 'highlight.js');
31+
32+
if (existsSync(localDir)) {
33+
return yarnDir;
34+
}
35+
36+
throw 'Error: highlight.js not found in node_modules';
3137
}
3238

3339
function getLanguages() {

0 commit comments

Comments
 (0)