use a more robust way to gather build directory name