Skip to content

Commit

Permalink
Only read and parse .js and .tsx files in the commands folder (#21)
Browse files Browse the repository at this point in the history
* Add support for typescript

* Only support .js and .tsx files in commands dir

* Delete package-lock.json

Co-authored-by: Vadim Demedes <[email protected]>
  • Loading branch information
zimme and Vadim Demedes committed Jan 12, 2020
1 parent cf75d76 commit 0b883df
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 => path.endsWith('.js') || path.endsWith('.tsx')).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 0b883df

Please sign in to comment.