mirror of
https://github.com/asdf-vm/asdf-nodejs.git
synced 2024-10-06 07:42:08 +08:00
Fix print_index_tab to ensure cache is written
Prior to this change the `tee` call was susceptible to its output being closed causing the pipeline to exit with `SIGPIPE`. This change replaces `tee` with two parts. 1. Write directly to `"$index_file"` 2. `cat` the contents of `"$index_file"` to `stdout`. This way, if the receiving side of the pipe exits, `cat` will exit without impacting the index cache Reimplements #264
This commit is contained in:
parent
18f2a58981
commit
ce7652263a
@ -80,7 +80,8 @@ print_index_tab(){
|
||||
cat "$index_file"
|
||||
else
|
||||
cat "$temp_headers_file" | awk 'tolower($1) == "etag:" { print $2 }' > "$etag_file"
|
||||
echo "$index" | filter_version_candidates | tee "$index_file"
|
||||
echo "$index" | filter_version_candidates > "$index_file"
|
||||
cat "$index_file"
|
||||
fi
|
||||
|
||||
rm "$temp_headers_file"
|
||||
|
Loading…
Reference in New Issue
Block a user