Skip to content

Commit b32cbba

Browse files
committed
rough in basic ecosystem support for composer/go/maven/nuget/ruby
1 parent bbe9215 commit b32cbba

18 files changed

Lines changed: 4569 additions & 12 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/socket-patch-cli/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ tempfile = { workspace = true }
2626
[features]
2727
default = []
2828
cargo = ["socket-patch-core/cargo"]
29+
gem = ["socket-patch-core/gem"]
30+
golang = ["socket-patch-core/golang"]
31+
maven = ["socket-patch-core/maven"]
32+
composer = ["socket-patch-core/composer"]
33+
nuget = ["socket-patch-core/nuget"]
2934

3035
[dev-dependencies]
3136
sha2 = { workspace = true }

crates/socket-patch-cli/src/commands/get.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,15 @@ pub async fn run(args: GetArgs) -> i32 {
356356
} else if args.global {
357357
println!("No global packages found.");
358358
} else {
359+
let mut install_cmds = String::from("npm/yarn/pnpm/pip");
359360
#[cfg(feature = "cargo")]
360-
let install_cmds = "npm/yarn/pnpm/pip/cargo";
361-
#[cfg(not(feature = "cargo"))]
362-
let install_cmds = "npm/yarn/pnpm/pip";
361+
install_cmds.push_str("/cargo");
362+
#[cfg(feature = "golang")]
363+
install_cmds.push_str("/go");
364+
#[cfg(feature = "maven")]
365+
install_cmds.push_str("/mvn");
366+
#[cfg(feature = "composer")]
367+
install_cmds.push_str("/composer");
363368
println!("No packages found. Run {install_cmds} install first.");
364369
}
365370
return 0;

crates/socket-patch-cli/src/commands/scan.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub struct ScanArgs {
4444
#[arg(long = "api-token")]
4545
pub api_token: Option<String>,
4646

47-
/// Restrict scanning to specific ecosystems (comma-separated: npm,pypi,cargo)
47+
/// Restrict scanning to specific ecosystems (comma-separated: npm,pypi,cargo,maven)
4848
#[arg(long, value_delimiter = ',')]
4949
pub ecosystems: Option<Vec<String>>,
5050
}
@@ -126,10 +126,15 @@ pub async fn run(args: ScanArgs) -> i32 {
126126
} else if args.global || args.global_prefix.is_some() {
127127
println!("No global packages found.");
128128
} else {
129+
let mut install_cmds = String::from("npm/yarn/pnpm/pip");
129130
#[cfg(feature = "cargo")]
130-
let install_cmds = "npm/yarn/pnpm/pip/cargo";
131-
#[cfg(not(feature = "cargo"))]
132-
let install_cmds = "npm/yarn/pnpm/pip";
131+
install_cmds.push_str("/cargo");
132+
#[cfg(feature = "golang")]
133+
install_cmds.push_str("/go");
134+
#[cfg(feature = "maven")]
135+
install_cmds.push_str("/mvn");
136+
#[cfg(feature = "composer")]
137+
install_cmds.push_str("/composer");
133138
println!("No packages found. Run {install_cmds} install first.");
134139
}
135140
return 0;

0 commit comments

Comments
 (0)