Skip to content

Exec the file instead of using cargo run #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ Useful command-line arguments:

- `--bench`: Compile and run benchmarks. Requires a nightly toolchain.
- `--debug`: Build a debug executable, not an optimised one.
- `--features <features>`: Cargo features to pass when building and running.
- `--force`: Force the script to be rebuilt. Useful if you want to force a recompile with a different toolchain.
- `--gen-pkg-only`: Generate the Cargo package, but don't compile or run it. Effectively "unpacks" the script into a Cargo package.
- `--test`: Compile and run tests.
Expand Down
7 changes: 0 additions & 7 deletions src/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::build_kind::BuildKind;
pub struct Args {
pub script: Option<String>,
pub script_args: Vec<String>,
pub features: Option<String>,

pub expr: bool,
pub loop_: bool,
Expand Down Expand Up @@ -108,11 +107,6 @@ impl Args {
.multiple_occurrences(true)
.requires("expr_or_loop")
)
.arg(Arg::new("features")
.help("Cargo features to pass when building and running.")
.long("features")
.takes_value(true)
)
.arg(Arg::new("unstable_features")
.help("Add a #![feature] declaration to the crate.")
.long("unstable-feature")
Expand Down Expand Up @@ -214,7 +208,6 @@ impl Args {
Args {
script,
script_args,
features: m.value_of("features").map(Into::into),

expr: m.is_present("expr"),
loop_: m.is_present("loop"),
Expand Down
2 changes: 1 addition & 1 deletion src/build_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub enum BuildKind {
impl BuildKind {
pub fn exec_command(&self) -> &'static str {
match *self {
Self::Normal => "run",
Self::Normal => "build",
Self::Test => "test",
Self::Bench => "bench",
}
Expand Down
2 changes: 1 addition & 1 deletion src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ edition = "2021"

[[bin]]
name = "#{bin_name}"
path = "#{file}.rs"
path = "#{file}"

[profile.release]
strip = true
Expand Down
Loading