Cleanup list navigates; spend bars; office writes the missing scaffold; memory read-out per agent
This commit is contained in:
42
bin/office
42
bin/office
@@ -39,6 +39,44 @@ def parse(argv):
|
||||
return opts
|
||||
|
||||
|
||||
def scaffold(folder, name):
|
||||
"""Write the files this project keeps, and only the ones that are missing.
|
||||
|
||||
Anything already there is left exactly as it is: adopting a folder must never
|
||||
overwrite a person's own notes or scripts.
|
||||
"""
|
||||
written = []
|
||||
harness = os.path.join(folder, ".harness")
|
||||
os.makedirs(harness, exist_ok=True)
|
||||
|
||||
verify = os.path.join(harness, "verify.sh")
|
||||
if not os.path.exists(verify):
|
||||
with open(verify, "w") as f:
|
||||
f.write("""#!/bin/sh
|
||||
# The command that decides a task in this project is finished.
|
||||
#
|
||||
# Leave it as it is to accept that there is no agreed command: bin/merge will
|
||||
# say so and let the review decide. Replace the body with the real one when the
|
||||
# project has tests, for example:
|
||||
#
|
||||
# exec go test ./...
|
||||
# exec make test
|
||||
echo "no verify command agreed for this project"
|
||||
exit 0
|
||||
""")
|
||||
os.chmod(verify, 0o755)
|
||||
written.append(verify)
|
||||
|
||||
notes = os.path.join(harness, "NOTES.md")
|
||||
if not os.path.exists(notes):
|
||||
with open(notes, "w") as f:
|
||||
f.write("# %s\n\nWhat this project is, what finished looks like, and anything a person\n"
|
||||
"picking it up next week needs to know. Notes only: tasks live in Paperclip.\n" % name)
|
||||
written.append(notes)
|
||||
|
||||
return written
|
||||
|
||||
|
||||
def main():
|
||||
opts = parse(sys.argv[1:])
|
||||
folder = os.path.abspath(os.path.expanduser(opts["folder"]))
|
||||
@@ -101,6 +139,10 @@ def main():
|
||||
pj.register(cfg, proj["name"])
|
||||
h.say("recorded in %s" % pj.REGISTRY)
|
||||
|
||||
written = scaffold(folder, proj["name"])
|
||||
for path in written:
|
||||
h.say("wrote %s" % path)
|
||||
|
||||
# The pages are built by this machine, from this folder, in this session.
|
||||
code = os.spawnv(
|
||||
os.P_WAIT,
|
||||
|
||||
Reference in New Issue
Block a user