Skip to content

Commit

Permalink
fix(factory): resolveFromLocal
Browse files Browse the repository at this point in the history
  • Loading branch information
neikvon committed Nov 25, 2020
1 parent 36dd835 commit 3628b51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export abstract class BaseClass {

error(...messages: any[]): this {
const errors = messages.map((err: any) =>
isString(err) ? err : (err.stack && cleanError(err.stack)) || err
isString(err) ? err : (err?.stack && cleanError(err.stack)) || err
)
console.log(chalk.red(symbols.cross), ...errors.map((m) => safeStylized(m, chalk.red)))
return this
Expand Down
7 changes: 2 additions & 5 deletions src/fbi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,7 @@ export class Fbi extends Factory {
if (!realpath) {
return null
}
const arr = realpath.split(sep)
const idx = arr.lastIndexOf('node_modules')
const dir = arr.slice(0, idx + 2).join(sep)
this.debug(`Factory "${targetId}" found in node_modules`)
return this.createFactory(dir)
this.debug(`Factory "${targetId}" found in local`)
return this.createFactory(realpath)
}
}

0 comments on commit 3628b51

Please sign in to comment.