buildserver: run dir check as very first thing

No point in running any other code if the script is just going to bail
out with an error.  This assumes that ./makebuildserver is only ever
run from a git clone of fdroidserver.git.
This commit is contained in:
Hans-Christoph Steiner 2016-09-26 07:11:22 -04:00
parent a3d32c65a4
commit 1b09ab5a79

View file

@ -13,6 +13,11 @@ from clint.textui import progress
from optparse import OptionParser
if not os.path.exists('makebuildserver') and not os.path.exists('buildserver'):
print('This must be run as ./makebuildserver in fdroidserver.git!')
sys.exit(1)
def vagrant(params, cwd=None, printout=False):
"""Run vagrant.
@ -87,10 +92,6 @@ elif os.path.exists('makebs.config.py'):
if '__builtins__' in config:
del(config['__builtins__']) # added by compile/exec
if not os.path.exists('makebuildserver') or not os.path.exists(serverdir):
print('This must be run from the correct directory!')
sys.exit(1)
if os.path.exists(boxfile):
os.remove(boxfile)