Closed helitik closed 5 years ago
Hi @helitik
the --watch
works with command that eat the YAML files (es. cat)
you can run
yamlinc --watch cat doc/src/index.yaml
in this way every-time, the file change a cat
can be repeated.
is useful when you start a service and need re-restart if configuration changes
Hi @francescobianco ,
Thank you for your answer!
I've found sourcey/spectacle but this is not compatible with openapi 3.0.
I use widdershins with cli api2html and i'm watching yaml files with yamlinc:
yamlinc --watch "api2html -o doc/dist/index.html -l shell,http,php,javascript" doc/src/index.yaml
I have to write quotes otherwise the -o option of api2html is in conflict with yamlinc (yamlinc write yaml in doc/dist/index.html).
But I get an error with quotes:
Error: spawn api2html -o doc/dist/index.html -l shell,http,php,javascript ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
I've fixed helpers.js line 66:
let wrapper = spawn(cmd, args, { shell: true });
And it works perfectly.
I also found a bug in yamlinc.js line 280:
let match = [];
for (let i in this.extensions) {
match.push('./**/*.*');
}
I've fixed by:
let match = [];
for (let i in this.extensions) {
match.push('./**/*.' + this.extensions[i]);
}
If you are interested, I can make a pull request.
@helitik Thanks for your supports... let start with pull-request.
@helitik In order to make this project grow, I invite all those who contribute to becoming official collaborators. Check out for the invitation on email
Done by #18
Hi @helitik your patch is online on the new version https://www.npmjs.com/package/yamlinc/v/0.1.9 Thanks
Hi,
I'm wondering how the watch works.
I'm trying :
yamlinc --watch doc/src/index.yaml
But I get a spawn error:
Any idea how I can fix that ?