BSD utilities on macOS do not ignore trailing slashes in commands, which results in this script incorrectly copying files to /tools/agbcc, rather than the intended /tools/agbcc/include. Removing the trailing slash should prevent this from happening, and allow macOS users to use the tool as intended.
Stop the script on the first error using the set -e command