From c649e450eebfd3aea474ee6905a3a1f1a3c53a5b Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Fri, 6 Sep 2024 19:53:27 -0400 Subject: [PATCH] Also `grep -v` out `.cargo_vcs_info.json` in `cargo-zng` In addition to `Cargo.toml.orig`. This also refactors the command to use fixed string (`-F`) and match whole lines (`-x`), to eliminate the `^` and `$` anchors and `\` escapes from the pattern. See #214. --- cargo-zng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cargo-zng b/cargo-zng index 8ff1193..4dd8ee3 100755 --- a/cargo-zng +++ b/cargo-zng @@ -4,7 +4,7 @@ tempdir="$(mktemp -d)" trap 'rm -rf "$tempdir"' 0 INT cargo package -l --allow-dirty | tr '\\' '/' | - grep -v '^Cargo\.toml\.orig$' | + grep -vxF -e Cargo.toml.orig -e .cargo_vcs_info.json | tar --files-from=- -cf - | tar -C "$tempdir" -xf - cp Cargo-zng.toml "$tempdir/Cargo.toml"