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