Again, I forgot to make vars.py not crash if the variables aren't set, so we can print a useful error message. But this time I have the right solution: vars.py will do the checking for itself, and abort with a nice message.
15 lines
342 B
Python
Executable file
15 lines
342 B
Python
Executable file
#!/usr/bin/python
|
|
import sys, os
|
|
import vars, state
|
|
from helpers import err, mkdirp
|
|
|
|
|
|
try:
|
|
for t in sys.argv[1:]:
|
|
if os.path.exists(t):
|
|
err('redo-ifcreate: error: %r already exists\n' % t)
|
|
sys.exit(1)
|
|
else:
|
|
state.add_dep(vars.TARGET, 'c', t)
|
|
except KeyboardInterrupt:
|
|
sys.exit(200)
|