You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote some custom templates, that I want to reuse over several projects.
Therefore I added them to a public github repository.
Allowing to provide the template by url, would help a lot. e.g. https://raw.githubusercontent.com/...
Otherwise I would have to 1st save the template locally by using wget / curl or so, then generating the changelog and finally deleting the template again.
As the methods you use from fs package already support handling an URL, I expect just a minor modification in your code: trying to instantiate an URL Object from given template string. https://nodejs.org/api/url.html#url_the_whatwg_url_api
So having a try catch around and if the above fails, just continue with the previous value.
I try to provide a PR.
Or do you have another approach?
The text was updated successfully, but these errors were encountered:
Using fs.access() to check for the accessibility of a file before calling fs.open(), fs.readFile() or fs.writeFile() is not recommended. Doing so introduces a race condition, since other processes may change the file's state between the two calls. Instead, user code should open/read/write the file directly and handle the error raised if the file is not accessible.
It might work for your case - no question, just wanted to forward this to you in addition.
Hey Pete,
I wrote some custom templates, that I want to reuse over several projects.
Therefore I added them to a public github repository.
Allowing to provide the template by url, would help a lot. e.g. https://raw.githubusercontent.com/...
Otherwise I would have to 1st save the template locally by using wget / curl or so, then generating the changelog and finally deleting the template again.
As the methods you use from fs package already support handling an URL, I expect just a minor modification in your code: trying to instantiate an URL Object from given template string.
https://nodejs.org/api/url.html#url_the_whatwg_url_api
So having a try catch around and if the above fails, just continue with the previous value.
I try to provide a PR.
Or do you have another approach?
The text was updated successfully, but these errors were encountered: