From e3237cd3b5a943c1ec861347954e2edd44166981 Mon Sep 17 00:00:00 2001 From: Myrddin Dundragon Date: Tue, 24 Jun 2025 22:12:31 -0400 Subject: [PATCH] Adjusted the SPDX Header and made a STAMP constant The SPDX_HEADER constant was changed to the STAMP constant and the SPDX_HEADER is now "// SPDX-License-Identifier:". --- src/stamper.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/stamper.rs b/src/stamper.rs index c7b8e6e..705ac52 100644 --- a/src/stamper.rs +++ b/src/stamper.rs @@ -7,7 +7,8 @@ use std::{fs, io}; -const SPDX_HEADER: &str = "\ +const SPDX_HEADER: &str = "// SPDX-License-Identifier:"; +const STAMP: &str = "\ // SPDX-License-Identifier: Apache-2.0 // Sealed with Magistamp. @@ -47,7 +48,7 @@ impl Stamper { if let Ok(content) = read_to_string(path) { - if content.starts_with("// SPDX-License-Identifier:") + if content.starts_with(SPDX_HEADER) { return; // Already has a header } @@ -55,7 +56,7 @@ impl Stamper println!("🪄 Magistamp: sealing {} with SPDX protection...", path.display()); - let new_content = format!("{SPDX_HEADER}{content}"); + let new_content = format!("{STAMP}{content}"); if let Err(e) = write(path, new_content) { eprintln!("Failed to write to {}: {}", path.display(), e);