neutralinojs/neutralinojs-cli

Do we really need readDirectory in runner.js?

shalithasuranga opened this issue · 5 comments

I am not sure why we need to use the existing readDirectory function by re-constructing the output of fs.readdirSync. Can we use the fs API directly in the test file without the wrapper function?

Assignee @pathange-s

There might arise a case surely in the future where we will need to get the files present in the directory. So, I thought of creating a separate function for that. I feel having it this way keeps the code modular. Let me know.

For example, check out this. We are calling readDirectory a couple of times. Removing this will lead to writing duplicate code.
https://github.com/neutralinojs/neutralinojs-cli/blob/master/spec/build.spec.js

There might arise a case surely in the future where we will need to get the files present in the directory. So, I thought of creating a separate function for that. I feel having it this way keeps the code modular. Let me know.

For example, check out this. We are calling readDirectory a couple of times. Removing this will lead to writing duplicate code. https://github.com/neutralinojs/neutralinojs-cli/blob/master/spec/build.spec.js

Hey @shalithasuranga, considering this is this issue still up for contributions?

@shalithasuranga and @Sadaf-A ,
I also agree with the suggestions made above by @pathange-s, although yes we can use fs API directly.

please do let me know about your suggestions, I will do the needful.

@shalithasuranga, I analyzed this minor issue and I think was correct. so I raised the PR regarding this
please review it and merge it #257 .

thanks

Fixed via #257 .. Thanks 🎉