Skip to content

Commit ae1bf51

Browse files
committed
Add compile_error! binary to powerpack crate
This directs people to install the `powerpack-cli` crate if they try to install `powerpack` as a binary.
1 parent 3f541ca commit ae1bf51

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
- name: Clippy
3636
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
37-
run: cargo clippy --workspace --all-targets
37+
run: cargo clippy --workspace --all-targets --all-features
3838

3939
- name: Test
4040
run: cargo test --workspace

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ default = ["env"]
2727
detach = ["dep:powerpack-detach"]
2828
env = ["dep:powerpack-env"]
2929

30+
# Private API: Prevents the compile_error! for the powerpack binary
31+
_internal_test = []
32+
3033
[profile.release]
3134
strip = true

src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#[cfg(not(feature = "_internal_test"))]
2+
compile_error! {"you meant to install powerpack-cli: type `cargo install powerpack-cli`"}
3+
fn main() {
4+
eprintln!("you meant to install powerpack-cli: type `cargo install powerpack-cli`");
5+
std::process::exit(1);
6+
}

0 commit comments

Comments
 (0)