Added "cd CMSDIST" after the build command and before "git remote add $USER <your-cmsdist-fork>" since after the popd you are in the wrong directory.