Re-fix logic for finding the beta version number
This reverts commit 542b6fce139047b5a0fa42ae11179a2308ac8f9e. and uses the --exclude option instead.