From 0b1457d0410a437a3b3aeaa8597d40beb0c84021 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sun, 14 Apr 2024 15:27:23 -0700 Subject: [PATCH] cargo: explicitly indicate paths to publish Running `cargo publish` from a non-colocated repo (such as my usual repo) is currently quite scary because it uploads all non-hidden files, even if they're ignored by `.gitignore` (https://github.com/rust-lang/cargo/issues/2063). I noticed this a while ago and have always run the command from a fresh clone since then. To avoid the need for that, let's use the workaround mentioned on the bug, which is to explicitly list patterns we want to publish. --- cli/Cargo.toml | 2 ++ lib/Cargo.toml | 2 ++ lib/proc-macros/Cargo.toml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1444902a56..746f631fc7 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -13,6 +13,8 @@ repository = { workspace = true } documentation = { workspace = true } keywords = { workspace = true } +include = ["/LICENSE", "/examples/", "/src/", "/testing/", "/tests/"] + [[bin]] name = "jj" path = "src/main.rs" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 760578f8a3..6847688580 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -12,6 +12,8 @@ repository = { workspace = true } documentation = { workspace = true } readme = { workspace = true } +include = ["/LICENSE", "/benches/", "/src/", "/tests/"] + [[test]] name = "runner" diff --git a/lib/proc-macros/Cargo.toml b/lib/proc-macros/Cargo.toml index 4bba85cfc0..e26bfa26ba 100644 --- a/lib/proc-macros/Cargo.toml +++ b/lib/proc-macros/Cargo.toml @@ -11,6 +11,8 @@ repository = { workspace = true } documentation = { workspace = true } readme = { workspace = true } +include = ["/LICENSE", "/src/"] + [lib] proc-macro = true