Skip to content
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

Make elm-tooling work with curl 8.6.0 #128

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/commands/Install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,14 @@ export function downloadFile(
}
};

// `-w ""` overrides `-w "\n"` which people might have in their .curlrc due to this:
// `-w "%{stderr}"` overrides `-w "\n"` which people might have in their .curlrc due to this:
// https://stackoverflow.com/a/14614203/2010616
// Otherwise they’ll get a byte/hash mismatch due to the extra newline.
const curl = spawn(env, "curl", ["-#fLw", "", url]);
// `%{stderr}` doesn’t print anything of itself, it just makes the rest of the
// `-w` string get written to stderr. “The rest of the string” is nothing in this case.
// Note that `-w ""` is invalid since curl 8.6.0:
// https://github.com/curl/curl/commit/07bcae89d5d0090f1d11866d5f9c98c3720a2838
const curl = spawn(env, "curl", ["-#fLw", "%{stderr}", url]);
let toKill: { kill: () => void } = curl;
curl.stdout.on("data", onData);
curl.stderr.on("data", onStderr);
Expand Down
Loading