summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--policy/.gitignore8
-rw-r--r--src/bin/butckrepo-refresh.rs30
2 files changed, 26 insertions, 12 deletions
diff --git a/policy/.gitignore b/policy/.gitignore
new file mode 100644
index 0000000..7e9c5c6
--- /dev/null
+++ b/policy/.gitignore
@@ -0,0 +1,8 @@
+*
+!README.md
+!_policies/
+!_policies/**
+!butck/
+!butck/**
+!.gitignore
+!registry.toml
diff --git a/src/bin/butckrepo-refresh.rs b/src/bin/butckrepo-refresh.rs
index ea7e753..9003575 100644
--- a/src/bin/butckrepo-refresh.rs
+++ b/src/bin/butckrepo-refresh.rs
@@ -58,7 +58,8 @@ async fn main() {
let cargo_toml_pathes = find_cargo_toml_dirs(&current_dir.join("policy")).await;
println!(
- "Found {} crates, register to `{}`",
+ "{} {} crates, register to `{}`",
+ "Found".bright_blue().bold(),
cargo_toml_pathes.len(),
CARGO_TOML_PATH.bright_green()
);
@@ -207,19 +208,24 @@ async fn collect(policy_crate_path: &Path) -> Option<CollectedPolicy> {
stream_struct_id,
) = collect_matched_func(lib_rs_content.as_str())?;
- println!(
- "{} {} (at: `{}`) with func `{}{}{}{}(..)`",
- "Register:".bright_blue().bold(),
- crate_name,
- crate_path.bright_green(),
- "pub ".bright_magenta(),
- if matched_func_has_await { "async " } else { "" }.bright_magenta(),
- "fn ".bright_magenta(),
- matched_func.bright_blue(),
- );
+ if !matched_func.is_empty() {
+ println!(
+ "{} {} (at: `{}`) with func `{}{}{}{}(..)`",
+ "Register:".bright_blue().bold(),
+ crate_name,
+ crate_path.bright_green(),
+ "pub ".bright_magenta(),
+ if matched_func_has_await { "async " } else { "" }.bright_magenta(),
+ "fn ".bright_magenta(),
+ matched_func.bright_blue(),
+ );
+ }
if let Some(stream_func) = &matched_func_stream {
println!(
- " and stream func `{}{}{}{}(..)`",
+ "{} {} (at: `{}`) with stream func `{}{}{}{}(..)`",
+ "Register:".bright_blue().bold(),
+ crate_name,
+ crate_path.bright_green(),
"pub ".bright_magenta(),
if matched_func_stream_has_await {
"async "