Skip to content

Commit 91f625d

Browse files
committed
Skip IAM policies that look like they've already been updated.
1 parent 105b2a6 commit 91f625d

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

aws_doc_sdk_examples_tools/agent/make_prompts.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,19 @@ def write_prompts(doc_gen: DocGen, out_dir: Path, language: str) -> None:
2323
examples = doc_gen.examples
2424
snippets = doc_gen.snippets
2525
for example_id, example in examples.items():
26-
prompt_path = out_dir / f"{example_id}.md"
27-
snippet_key = (
28-
example.languages[language]
29-
.versions[0]
30-
.excerpts[0]
31-
.snippet_files[0]
32-
.replace("/", ".")
33-
)
34-
snippet = snippets[snippet_key]
35-
prompt_path.write_text(snippet.code, encoding="utf-8")
26+
# "Title" and "Abbrev" are the defaults. If they're not there, it suggests we've already
27+
# added new titles.
28+
if example.title.startswith("Title") and example.title_abbrev.startswith("Abbrev"):
29+
prompt_path = out_dir / f"{example_id}.md"
30+
snippet_key = (
31+
example.languages[language]
32+
.versions[0]
33+
.excerpts[0]
34+
.snippet_files[0]
35+
.replace("/", ".")
36+
)
37+
snippet = snippets[snippet_key]
38+
prompt_path.write_text(snippet.code, encoding="utf-8")
3639

3740

3841
def setup_ailly(system_prompts: List[str], out_dir: Path) -> None:

0 commit comments

Comments
 (0)