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.
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.