makerdao / spells-mainnet

Staging repo for MakerDAO weekly executive spells
GNU Affero General Public License v3.0
107 stars 43 forks source link

`diff-deployed-spell` script requires some improvements #352

Closed amusingaxl closed 1 year ago

amusingaxl commented 1 year ago

I noticed that sometimes the Etherscan API returns the source code with Windows-style line-breaks (\n\r). This would break the diff in any Unix-based system.

Also, bash has some slightly different implementations across MacOS and Linux, so it's a good idea to avoid the shell trying to be funny with strings.


Another problem is that sometimes the only difference between the repo and the spell code is a trailing new-line.

That would cause diff to exit with a non-zero code, making the script fail, which would prevent this script to be used in tandem with any other scripts following it, even if the diff is fine.