def build_chart(name, version=None, paths=None):
chart_file = os.path.join(name, '<STR_LIT>')<EOL>with open(chart_file) as f:<EOL><INDENT>chart = yaml.load(f)<EOL><DEDENT>if version is None:<EOL><INDENT>if paths is None:<EOL><INDENT>paths = ['<STR_LIT:.>']<EOL><DEDENT>commit = last_modified_commit(*paths)<EOL>version = chart['<STR_LIT:version>'].split('<STR_LIT:->')[<NUM_LIT:0>] + '<STR_LIT:->' + commit<EOL><DEDENT>chart['<STR_LIT:version>'] = version<EOL>with open(chart_file, '<STR_LIT:w>') as f:<EOL><INDENT>yaml.dump(chart, f)<EOL><DEDENT>return version<EOL>
Update chart with specified version or last-modified commit in path(s)