-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1235 notify third parties for changes in the license book #1305
1235 notify third parties for changes in the license book #1305
Conversation
Note for reviewer: We use diff package due to broken behaviour of Node's child_process module when |
7e08528
to
819b1ae
Compare
@philippfromme ready. |
What is the broken behavior and why / how does it apply to setup? |
Previously, I tried to use execa.sync to generate diff: const exec = require('execa').sync;
const diff = exec('diff', ['-u', '-', file], { input: anotherFile }).stdout; However, it always throws error when the files differ. Anyway, the alternative would be to read |
Thanks for the note. I'd personally prefer built-in utilities, especially if the alternative is to require another dependency that is really only required on the CI. Just to understand correctly, what we'd need is something like this, right? const exec = require('execa').sync;
async function computeDiff(file, otherFile) {
// diff exits with <1> if a diff exists; we must account for that special behavior
// cf. https://github.com/nodejs/node/issues/19494#issuecomment-374721063
try {
return exec('diff', ['-u', '-', file], { input: otherFile }).stdout;
} catch (e) {
if (e.code !== 1) {
throw e;
}
return e.stdout;
}
} |
Should I review this or not? |
@nikku Correct, this is more or less what I wrote before. @philippfromme I'll include Nico's suggestion and then it's ready. Just a sec. |
6f8140b
to
8d19965
Compare
@philippfromme ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐎
Closes #1235