The way this was, the curl interferes with the bash invocation. Here it will authenticate first.
Changes made for macOS specific for that style of system. Paths are established/defined singularly and modes are set automatically when created. (Platform specific.)