faheel / BigInt

Arbitrary-sized integer class for C++
https://faheel.github.io/BigInt
MIT License
390 stars 132 forks source link

Modify usage of `sed` to be compatible with macOS #30

Closed KingAkeem closed 6 years ago

KingAkeem commented 6 years ago

Mac OS uses a different sed command from GNU. In order to use the -i flag you must pass the extension along with it so I added the .hpp extension if darwin is detected as the OS.

codecov[bot] commented 6 years ago

Codecov Report

Merging #30 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #30   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          13     13           
  Lines         536    536           
=====================================
  Hits          536    536

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 69dd72f...c32d115. Read the comment docs.

faheel commented 6 years ago

Good find! But instead of using a modified command to make it work on a different OS, I think we should use those commands that work the same on multiple OSs.

So I suggest you change the sed -i ... line to the following:

sed "/#include \"*\"/d" "$release_file" > "$release_file.tmp"
mv "$release_file.tmp" "$release_file"
faheel commented 6 years ago

Thank you for contributing! :+1: