13 parser = argparse.ArgumentParser(
14 description=
'Executes a command, then rewrites the depfile, converts all absolute paths to relative'
16 parser.add_argument(
'--depfile', help=
'Path to the depfile to rewrite', required=
True)
17 parser.add_argument(
'command', nargs=
'+', help=
'Positional args for the command to run')
18 args = parser.parse_args()
20 retval = subprocess.call(args.command)
25 with open(args.depfile,
'r')
as f:
27 lines.append(
' '.
join(os.path.relpath(p)
for p
in line.split()))
28 with open(args.depfile,
'w')
as f:
29 f.write(
'\n'.
join(lines))
32if __name__ ==
'__main__':
static SkString join(const CommandLineFlags::StringArray &)