spm_swift_package/presentation/
header.rs

1use clap::Command;
2use colored::{Color, Colorize};
3
4pub struct Header;
5
6impl Header {
7	const VERSION: &'static str = "0.10.0";
8
9	pub fn show() -> String {
10		Self::check_version();
11
12		let orange = Color::TrueColor {
13			r: 240,
14			g: 81,
15			b: 56,
16		};
17
18		format!(
19			"\n{}\n\
20             🚀 You can create your Swift Package via the command line 🔨\n\
21             v{}\n",
22			"SPM Swift Package".color(orange),
23			Self::VERSION
24		)
25	}
26
27	fn check_version() {
28		let _ = Command::new("spm-swift-package")
29			.version(Self::VERSION)
30			.ignore_errors(true)
31			.get_matches();
32	}
33}