Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fix: exclude spec files from being loaded as commands (#46)
Browse files Browse the repository at this point in the history
Resolves #158
  • Loading branch information
hassankhan authored and jdx committed Aug 27, 2018
1 parent f783839 commit 5854d34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ export class Plugin implements IPlugin {
return []
}
this._debug(`loading IDs from ${this.commandsDir}`)
const ids = globby.sync(['**/*.+(js|ts)', '!**/*.+(d.ts|test.ts|test.js)'], {cwd: this.commandsDir})
const patterns = [
'**/*.+(js|ts)',
'!**/*.+(d.ts|test.ts|test.js|spec.ts|spec.js)',
]
const ids = globby.sync(patterns, {cwd: this.commandsDir})
.map(file => {
const p = path.parse(file)
const topics = p.dir.split('/')
Expand Down

0 comments on commit 5854d34

Please sign in to comment.