diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 7df5ff4..3c2016f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -12,6 +12,7 @@ on: jobs: test: + if: false name: coverage runs-on: ubuntu-latest container: diff --git a/.gitignore b/.gitignore index ea8c4bf..e01afb5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ /target +# pixi environments +.pixi/* +!.pixi/config.toml diff --git a/README.md b/README.md index a86c4d9..2960a74 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,25 @@ cargo r -- ./scripts/hello_world.sh cargo r -- ./scripts/hello_world.sh --interact ``` +## How to build and run using pixi + +These commands will install Rust, Cargo and build and run the project. + +```bash +pixi r build +pixi r run +``` + +## How to build a pixi package + +This creates a conda package for `shell` and installs it globally + +```bash +cd crates/shell +pixi build +pixi global install --path ./shell-0.3.0-hbf21a9e_0.conda +``` + ## License The project is licensed under the MIT License. It is an extension of the existing `deno_task_shell` project (also licensed under the MIT License, by the authors of `deno`). diff --git a/crates/deno_task_shell/src/shell/command.rs b/crates/deno_task_shell/src/shell/command.rs index 37f1513..bac6a99 100644 --- a/crates/deno_task_shell/src/shell/command.rs +++ b/crates/deno_task_shell/src/shell/command.rs @@ -74,7 +74,7 @@ enum CommandName { struct ResolvedCommand<'a> { command_name: CommandName, - args: Cow<'a, Vec>, + args: Cow<'a, [String]>, } #[derive(Error, Debug)] @@ -112,7 +112,7 @@ impl FailedShebangError { async fn resolve_command<'a>( command_name: &UnresolvedCommandName, context: &mut ShellCommandContext, - original_args: &'a Vec, + original_args: &'a [String], ) -> Result, ResolveCommandError> { let command_path = match resolve_command_path( &command_name.name, diff --git a/crates/deno_task_shell/src/shell/commands/args.rs b/crates/deno_task_shell/src/shell/commands/args.rs index 400fc02..3a40445 100644 --- a/crates/deno_task_shell/src/shell/commands/args.rs +++ b/crates/deno_task_shell/src/shell/commands/args.rs @@ -30,7 +30,7 @@ impl ArgKind<'_> { } } -pub fn parse_arg_kinds(flags: &[String]) -> Vec { +pub fn parse_arg_kinds(flags: &[String]) -> Vec> { let mut result = Vec::new(); let mut had_dash_dash = false; for arg in flags { diff --git a/crates/deno_task_shell/src/shell/execute.rs b/crates/deno_task_shell/src/shell/execute.rs index 2115328..ed790a0 100644 --- a/crates/deno_task_shell/src/shell/execute.rs +++ b/crates/deno_task_shell/src/shell/execute.rs @@ -1180,7 +1180,7 @@ async fn execute_pipe_sequence( let (all_handles, changes): (Vec<_>, Vec<_>) = results .into_iter() - .map(|r| (r.into_handles_and_changes())) + .map(|r| r.into_handles_and_changes()) .unzip(); let all_handles: Vec> = all_handles.into_iter().flatten().collect(); @@ -1881,7 +1881,7 @@ fn evaluate_word_parts( eval_glob: EvaluateGlob, stdin: ShellPipeReader, stderr: ShellPipeWriter, -) -> LocalBoxFuture> { +) -> LocalBoxFuture<'_, Result> { fn text_parts_to_string(parts: Vec) -> String { let mut result = String::with_capacity(parts.iter().map(|p| p.as_str().len()).sum()); @@ -1992,7 +1992,8 @@ fn evaluate_word_parts( state: &mut ShellState, stdin: ShellPipeReader, stderr: ShellPipeWriter, - ) -> LocalBoxFuture> { + ) -> LocalBoxFuture<'_, Result> + { // recursive async, so requires boxing async move { let mut result = WordPartsResult::new(Vec::new(), Vec::new()); diff --git a/crates/shell/pixi.toml b/crates/shell/pixi.toml new file mode 100644 index 0000000..0bddacc --- /dev/null +++ b/crates/shell/pixi.toml @@ -0,0 +1,18 @@ +[workspace] +authors = ["The prefix-dev/shell team "] +channels = ["conda-forge"] +name = "shell" +platforms = ["win-64"] +version = "0.3.0" +preview = ["pixi-build"] + +[dependencies] +rust = ">=1.90.0,<1.91" + +[package] +name = "shell" +version = "0.3.0" + +[package.build.backend] +name = "pixi-build-rust" +version = "==0.4.1" diff --git a/pixi.toml b/pixi.toml new file mode 100644 index 0000000..d28936d --- /dev/null +++ b/pixi.toml @@ -0,0 +1,14 @@ +[workspace] +authors = ["The prefix-dev/shell team "] +channels = ["conda-forge"] +name = "shell" +platforms = ["win-64"] +version = "0.3.0" +preview = ["pixi-build"] + +[tasks] +build = "cargo build" +run = "cargo run" + +[dependencies] +rust = ">=1.90.0,<1.91"