The CRLF line feeds cause errors running from sh:
> sh ./hat_install.sh
./hat_install.sh: line 2: $'\r': command not found
./hat_install.sh: line 4: cd: $'.\r': No such file or directory
./hat_install.sh: line 5: $'\r': command not found
./hat_install.sh: line 10: syntax error near unexpected token `done'
'/hat_install.sh: line 10: `done < <(find HATDependencies -type f -print0)