Fixed syntax error in selection of snapshots/release directory. This has to be done in bash if we are using =~. Instead, this was make portable (usable with sh) by using grep.
Fixed error in selection of snapshots/release directory for windows (ommission of an else if we are using releases)