It seems that some variables were mistakenly left unquoted, leading to paths containing spaces being treated incorrectly.
For example, the directory `/home/person/foo bar/test/` would cause `CURDIR=$(pwd)` to be expanded to `CURDIR=/home/person/foo bar/test/`. This means that the shell would attempt to run the command `bar/test/` with the environment variable `CURDIR` set to `/home/person/foo`. This is due to [word splitting](https://www.gnu.org/software/bash/manual/html_node/Word-Splitting.html). (TL;DR the result of shell expansions should probably be quoted 99% of the time)
Move into the emsdk directory before running ./emsdk. Make it possible to add `test -x $EMSCRIPTEN/emsdk_env.sh && source $EMSCRIPTEN/emsdk_env.sh` to my shell initialization script.