-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
117 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# TODO: remove this once we're no longer compiling C++ with Rust. | ||
[future-incompat-report] | ||
frequency = "never" | ||
|
||
[alias] | ||
tool-run-bin = ["run", "--quiet", "--package", "cargo-bin", "--"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "cargo-bin" | ||
version.workspace = true | ||
license.workspace = true | ||
edition.workspace = true | ||
|
||
[dependencies] | ||
cargo-run-bin = { version = "1.7.4", features = ["cli"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This package must be named `cargo-bin`, because `cargo-run-bin` needs to believe its binary is `cargo-bin`: <https://github.com/dustinblackman/cargo-run-bin/issues/21#issuecomment-2600372315> (even though [`cargo-bin`](https://crates.io/crates/cargo-bin) is also a separate thing that exists). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use std::{env, process}; | ||
|
||
fn main() { | ||
for argument in env::args() { | ||
println!("{argument}"); | ||
} | ||
let res = cargo_run_bin::cli::run(); | ||
|
||
dbg!(&res); | ||
|
||
// Only reached if run-bin code fails, otherwise process exits early from within | ||
// binary::run. | ||
if let Err(res) = res { | ||
eprintln!("\x1b[31m{}\x1b[0m", format!("run-bin failed: {res}")); | ||
process::exit(1); | ||
} | ||
} |