If your actual shell is /bin/sh [contrary to the initial question, but as discussion commentary has made clear], use = rather than == in your test expression:
elif [ "$basePath" = arrayscripts ]
Note that the right-hand side doesn't need to be quoted in this case, since it contains no expansions and no syntactically-sensitive characters.
Alternately, if this issue is reproducible when using bash, the obvious problem is missing quotes.
Use either
[ "$basePath" = arrayscripts ] # this is POSIX compatible
or
[[ $basePath = arrayscripts ]] # this works only with bash
Otherwise, the number of arguments $basePath expands into is undefined -- it may expand into zero arguments, making the statement
[ = arrayscripts ]
...which would try to use = as a unary operator, which it isn't...
or if $basePath contained, say, "true -o bar =", it could expand into something like
[ true -o bar = arrayscripts ]
...resulting in program behavior very different from what you actually want.
Bottom line: When writing for shells which follow POSIX rules (basically, anything but zsh or fish), quote your expansions unless you have a specific and compelling reason to do otherwise. (Use of the bash/ksh extension [[ ]] provides such a reason, by introducing a context in which string-splitting of expansion results and glob expansion don't take place).