Skip to content

Commit

Permalink
Hide "Unreleased" header in CHANGELOG for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigellute committed Oct 20, 2019
1 parent 5e4f646 commit d776b95
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,14 +704,22 @@ where
.border_style(get_color(highlight_state))
.render(f, layout_chunk);

let change_log = include_str!("../../CHANGELOG.md");
let changelog = include_str!("../../CHANGELOG.md").to_string();

// If debug mode show the "Unreleased" header. Otherwise it is a release so there should be no
// unreleased features
let clean_changelog = if cfg!(debug_assertions) {
changelog
} else {
changelog.replace("\n## [Unreleased]\n", "")
};

let top_text = vec![
Text::styled(BANNER, Style::default().fg(Color::LightCyan)),
Text::raw("\nPlease report any bugs or missing features to https://github.com/Rigellute/spotify-tui"),
];

let bottom_text = vec![Text::raw(change_log)];
let bottom_text = vec![Text::raw(clean_changelog)];

// Contains the banner
Paragraph::new(top_text.iter())
Expand Down

0 comments on commit d776b95

Please sign in to comment.