apenwarr-redo/redo/cmd_always.py
Avery Pennarun 4d2b4cfccb Make calls to logs.setup() explicit in each cmd.
Further reducing magic implicit behaviour to make code easier to
follow.
2018-12-11 02:35:11 +00:00

24 lines
599 B
Python

import sys, os
from . import env, logs, state
def main():
try:
env.inherit()
logs.setup(tty=sys.stderr, pretty=env.v.PRETTY, color=env.v.COLOR)
me = os.path.join(env.v.STARTDIR,
os.path.join(env.v.PWD, env.v.TARGET))
f = state.File(name=me)
f.add_dep('m', state.ALWAYS)
always = state.File(name=state.ALWAYS)
always.stamp = state.STAMP_MISSING
always.set_changed()
always.save()
state.commit()
except KeyboardInterrupt:
sys.exit(200)
if __name__ == '__main__':
main()