Handle KeyboardInterrupt with less annoying spew to stderr.

This commit is contained in:
Avery Pennarun 2010-11-13 02:09:42 -08:00
commit 3de384497d
3 changed files with 38 additions and 29 deletions

View file

@ -8,10 +8,13 @@ if not vars.TARGET:
err('redo-ifcreate: error: must be run from inside a .do\n')
sys.exit(100)
for t in sys.argv[1:]:
mkdirp('%s/.redo' % vars.BASE)
if os.path.exists(t):
err('redo-ifcreate: error: %r already exists\n' % t)
sys.exit(1)
else:
add_dep(vars.TARGET, 'c', t)
try:
for t in sys.argv[1:]:
mkdirp('%s/.redo' % vars.BASE)
if os.path.exists(t):
err('redo-ifcreate: error: %r already exists\n' % t)
sys.exit(1)
else:
add_dep(vars.TARGET, 'c', t)
except KeyboardInterrupt:
sys.exit(200)