diff --git a/Cargo.lock b/Cargo.lock index 542c3fb3..8f89b58d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2576,7 +2576,7 @@ dependencies = [ [[package]] name = "workspace-node-tools" -version = "1.0.10" +version = "1.0.11" dependencies = [ "chrono", "execute", diff --git a/Cargo.toml b/Cargo.toml index dabf84ed..7004402a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "workspace-node-tools" -version = "1.0.10" +version = "1.0.11" edition = "2021" description = "Node workspace version tools" repository = "https://github.com/websublime/workspace-node-tools" diff --git a/src/changes.rs b/src/changes.rs index b6ebbf48..2125cda4 100644 --- a/src/changes.rs +++ b/src/changes.rs @@ -212,7 +212,7 @@ pub fn add_change(change: &Change, cwd: Option) -> bool { let changes_file = File::create(changes_path).unwrap(); let changes_writer = BufWriter::new(changes_file); - serde_json::to_writer(changes_writer, &changes).unwrap(); + serde_json::to_writer_pretty(changes_writer, &changes).unwrap(); return true; } @@ -242,7 +242,7 @@ pub fn remove_change(branch_name: String, cwd: Option) -> bool { let changes_file = File::create(changes_path).unwrap(); let changes_writer = BufWriter::new(changes_file); - serde_json::to_writer(changes_writer, &changes).unwrap(); + serde_json::to_writer_pretty(changes_writer, &changes).unwrap(); return true; } diff --git a/src/packages.rs b/src/packages.rs index 0fce5fbd..0ba2ab49 100644 --- a/src/packages.rs +++ b/src/packages.rs @@ -277,6 +277,7 @@ pub fn get_packages(cwd: Option) -> Vec { changed_files: vec![], } }) + .filter(|pkg| !pkg.root) .collect::>() } Some(PackageManager::Yarn) | Some(PackageManager::Npm) => { @@ -503,7 +504,7 @@ mod tests { let packages = get_packages(project_root); - assert_eq!(packages.len(), 3); + assert_eq!(packages.len(), 2); remove_dir_all(&monorepo_dir)?; Ok(()) }