Skip to content

Conversation

LookinGit
Copy link
Contributor

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce?

Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@LookinGit LookinGit changed the title feat: add command to create listeners files feat: add missing commands to create files Apr 24, 2020
@thetutlage
Copy link
Member

thetutlage commented Apr 24, 2020

How about making it dynamic, so that we don't forget adding new commands in the future. It should be as simple as the following snippet.

import { join } from 'path'
import { fsReadAll } from '@poppinss/utils'
import { Manifest } from '@adonisjs/ace'

new Manifest(__dirname).generate(
  fsReadAll(join(__dirname, './commands'))
)

@LookinGit
Copy link
Contributor Author

LookinGit commented Apr 24, 2020

@thetutlage it will be look so:

fsReadAll(
  join(__dirname, './commands'),
  (file) => !file.includes('Base') && file.endsWith('.js')
).map(file => `./commands/${file}`)

add?

@thetutlage
Copy link
Member

Yup, looks good to me

@LookinGit LookinGit changed the title feat: add missing commands to create files feat: add dynamic read a files from a commands directory Apr 24, 2020
@thetutlage
Copy link
Member

Ace. Thanks for the PR 😄

@thetutlage thetutlage merged commit f0bea82 into adonisjs:develop Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants