Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions COMMITMSG
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fix: re-running `init` fails to remove tab-separated `install` lines - dese

- crates\cli\src\commands\init.rs: treat tab-separated install lines like space-separated

Fixes #200

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
11 changes: 10 additions & 1 deletion crates/cli/src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,21 @@ const GITIGNORE_ENTRIES: &[&str] = &[".skillfile/cache/", ".skillfile/conflict"]

/// Build a new manifest string with install lines replaced.
/// Pure transformation: takes existing content and new targets, returns new content.

fn is_install_line(stripped: &str) -> bool {
let rest = match stripped.strip_prefix("install") {
Some(r) => r,
None => return false,
};
rest.is_empty() || rest.starts_with(char::is_whitespace)
}

fn build_manifest_with_targets(existing: &str, new_targets: &[(String, String)]) -> String {
let mut non_install: Vec<&str> = existing
.lines()
.filter(|line| {
let stripped = line.trim();
!stripped.starts_with("install ") && stripped != "install"
!is_install_line(stripped) && stripped != "install"
})
.collect();

Expand Down
Loading