Closed shalithasuranga closed 6 months ago
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 https://github.com/neutralinojs/neutralinojs-cli/pull/257 .
thanks
Fixed via #257 .. Thanks :tada:
I am not sure why we need to use the existing
readDirectory
function by re-constructing the output offs.readdirSync
. Can we use thefs
API directly in the test file without the wrapper function?Assignee @pathange-s