MCPcopy Create free account
hub / github.com/apache/solr / update_build

Function update_build

dev-tools/scripts/scaffoldNewModule.py:27–41  ·  view source on GitHub ↗
(file_path, search_re, replace_line)

Source from the content-addressed store, hash-verified

25from textwrap import dedent
26
27def update_build(file_path, search_re, replace_line):
28 print('adding new module into %s' % file_path)
29 matcher = re.compile(search_re)
30
31 def edit(buffer, match, line):
32 if replace_line in line:
33 return None
34 match = matcher.search(line)
35 if match is not None:
36 buffer.append(replace_line)
37 buffer.append(line)
38 return match is not None
39
40 changed = update_file(file_path, matcher, edit)
41 print('done' if changed else 'uptodate')
42
43
44def read_config():

Callers 1

scaffold_folderFunction · 0.85

Calls 1

update_fileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…