dotnet / install-scripts

MIT License
145 stars 76 forks source link

Fix `cp -n` warning on modern linux #528

Closed am11 closed 1 month ago

am11 commented 1 month ago

Fixes https://github.com/dotnet/install-scripts/issues/436

baronfel commented 1 month ago

@am11 out of curiosity, why did you switch to the more explicit style? readability concerns or something functional in nature?

am11 commented 1 month ago

There was another case when override is not false for which override_switch had to be empty. Took care of it in the last commit.

am11 commented 1 month ago

@baronfel, it was that or

[ "$override" = false ] && override_switch="-n" && cp -u --help >/dev/null 2>&1 && override_switch="-u"

line was getting long, so I thought if-block would be better for readability. :)

baronfel commented 1 month ago

That makes perfect sense - thanks for the explanation :)