mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Remove Changelog: XXX title from Github release notes
This commit is contained in:
parent
c4681ea2cc
commit
d598164927
1 changed files with 9 additions and 0 deletions
|
@ -9,6 +9,15 @@ impl flags::PublishReleaseNotes {
|
||||||
pub(crate) fn run(self, sh: &Shell) -> anyhow::Result<()> {
|
pub(crate) fn run(self, sh: &Shell) -> anyhow::Result<()> {
|
||||||
let asciidoc = sh.read_file(&self.changelog)?;
|
let asciidoc = sh.read_file(&self.changelog)?;
|
||||||
let mut markdown = notes::convert_asciidoc_to_markdown(std::io::Cursor::new(&asciidoc))?;
|
let mut markdown = notes::convert_asciidoc_to_markdown(std::io::Cursor::new(&asciidoc))?;
|
||||||
|
if !markdown.starts_with("# Changelog") {
|
||||||
|
bail!("changelog Markdown should start with `# Changelog`");
|
||||||
|
}
|
||||||
|
const NEWLINES: &str = "\n\n";
|
||||||
|
let Some(idx) = markdown.find(NEWLINES) else {
|
||||||
|
bail!("missing newlines after changelog title");
|
||||||
|
};
|
||||||
|
markdown.replace_range(0..idx + NEWLINES.len(), "");
|
||||||
|
|
||||||
let file_name = check_file_name(self.changelog)?;
|
let file_name = check_file_name(self.changelog)?;
|
||||||
let tag_name = &file_name[0..10];
|
let tag_name = &file_name[0..10];
|
||||||
let original_changelog_url = create_original_changelog_url(&file_name);
|
let original_changelog_url = create_original_changelog_url(&file_name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue