Skip to content
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: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:

jobs:
test:
if: false
name: coverage
runs-on: ubuntu-latest
container:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/target
# pixi environments
.pixi/*
!.pixi/config.toml
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`).
4 changes: 2 additions & 2 deletions crates/deno_task_shell/src/shell/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ enum CommandName {

struct ResolvedCommand<'a> {
command_name: CommandName,
args: Cow<'a, Vec<String>>,
args: Cow<'a, [String]>,
}

#[derive(Error, Debug)]
Expand Down Expand Up @@ -112,7 +112,7 @@ impl FailedShebangError {
async fn resolve_command<'a>(
command_name: &UnresolvedCommandName,
context: &mut ShellCommandContext,
original_args: &'a Vec<String>,
original_args: &'a [String],
) -> Result<ResolvedCommand<'a>, ResolveCommandError> {
let command_path = match resolve_command_path(
&command_name.name,
Expand Down
2 changes: 1 addition & 1 deletion crates/deno_task_shell/src/shell/commands/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl ArgKind<'_> {
}
}

pub fn parse_arg_kinds(flags: &[String]) -> Vec<ArgKind> {
pub fn parse_arg_kinds(flags: &[String]) -> Vec<ArgKind<'_>> {
let mut result = Vec::new();
let mut had_dash_dash = false;
for arg in flags {
Expand Down
7 changes: 4 additions & 3 deletions crates/deno_task_shell/src/shell/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<JoinHandle<i32>> =
all_handles.into_iter().flatten().collect();
Expand Down Expand Up @@ -1881,7 +1881,7 @@ fn evaluate_word_parts(
eval_glob: EvaluateGlob,
stdin: ShellPipeReader,
stderr: ShellPipeWriter,
) -> LocalBoxFuture<Result<WordPartsResult, EvaluateWordTextError>> {
) -> LocalBoxFuture<'_, Result<WordPartsResult, EvaluateWordTextError>> {
fn text_parts_to_string(parts: Vec<TextPart>) -> String {
let mut result =
String::with_capacity(parts.iter().map(|p| p.as_str().len()).sum());
Expand Down Expand Up @@ -1992,7 +1992,8 @@ fn evaluate_word_parts(
state: &mut ShellState,
stdin: ShellPipeReader,
stderr: ShellPipeWriter,
) -> LocalBoxFuture<Result<WordPartsResult, EvaluateWordTextError>> {
) -> LocalBoxFuture<'_, Result<WordPartsResult, EvaluateWordTextError>>
{
// recursive async, so requires boxing
async move {
let mut result = WordPartsResult::new(Vec::new(), Vec::new());
Expand Down
18 changes: 18 additions & 0 deletions crates/shell/pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[workspace]
authors = ["The prefix-dev/shell team <hi@prefix.dev>"]
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"
14 changes: 14 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[workspace]
authors = ["The prefix-dev/shell team <hi@prefix.dev>"]
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"
Loading