Skip to content

Commit

Permalink
Only support .js and .tsx files in commands dir
Browse files Browse the repository at this point in the history
  • Loading branch information
zimme committed Jun 25, 2019
1 parent e4c0c24 commit 4f5f383
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/read-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const readCommands = async (commandsPath, dirPath) => {
const paths = fs.readdirSync(dirPath);
const commands = [];

const promises = paths.map(async path => {
const promises = paths.filter(path => ['.js', '.tsx'].find(ext => path.endsWith(ext))).map(async path => {
// Since `readdir` returns relative paths, we need to transform them to absolute paths
const fullPath = join(dirPath, path);
const stats = await stat(fullPath);
Expand Down

0 comments on commit 4f5f383

Please sign in to comment.