Skip to content

Commit f81a79f

Browse files
authored
Merge branch 'main' into display-unix-style-cwd
2 parents 143f127 + 7a197ad commit f81a79f

File tree

11 files changed

+365
-20
lines changed

11 files changed

+365
-20
lines changed

.github/workflows/coverage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
jobs:
1414
test:
15+
if: false
1516
name: coverage
1617
runs-on: ubuntu-latest
1718
container:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
/target
2+
# pixi environments
3+
.pixi/*
4+
!.pixi/config.toml

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,25 @@ cargo r -- ./scripts/hello_world.sh
4040
cargo r -- ./scripts/hello_world.sh --interact
4141
```
4242

43+
## How to build and run using pixi
44+
45+
These commands will install Rust, Cargo and build and run the project.
46+
47+
```bash
48+
pixi r build
49+
pixi r run
50+
```
51+
52+
## How to build a pixi package
53+
54+
This creates a conda package for `shell` and installs it globally
55+
56+
```bash
57+
cd crates/shell
58+
pixi build
59+
pixi global install --path ./shell-0.3.0-hbf21a9e_0.conda
60+
```
61+
4362
## License
4463

4564
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`).

crates/deno_task_shell/src/shell/command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ enum CommandName {
7474

7575
struct ResolvedCommand<'a> {
7676
command_name: CommandName,
77-
args: Cow<'a, Vec<String>>,
77+
args: Cow<'a, [String]>,
7878
}
7979

8080
#[derive(Error, Debug)]
@@ -112,7 +112,7 @@ impl FailedShebangError {
112112
async fn resolve_command<'a>(
113113
command_name: &UnresolvedCommandName,
114114
context: &mut ShellCommandContext,
115-
original_args: &'a Vec<String>,
115+
original_args: &'a [String],
116116
) -> Result<ResolvedCommand<'a>, ResolveCommandError> {
117117
let command_path = match resolve_command_path(
118118
&command_name.name,

crates/deno_task_shell/src/shell/commands/args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl ArgKind<'_> {
3030
}
3131
}
3232

33-
pub fn parse_arg_kinds(flags: &[String]) -> Vec<ArgKind> {
33+
pub fn parse_arg_kinds(flags: &[String]) -> Vec<ArgKind<'_>> {
3434
let mut result = Vec::new();
3535
let mut had_dash_dash = false;
3636
for arg in flags {

crates/deno_task_shell/src/shell/execute.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ async fn execute_pipe_sequence(
11801180

11811181
let (all_handles, changes): (Vec<_>, Vec<_>) = results
11821182
.into_iter()
1183-
.map(|r| (r.into_handles_and_changes()))
1183+
.map(|r| r.into_handles_and_changes())
11841184
.unzip();
11851185
let all_handles: Vec<JoinHandle<i32>> =
11861186
all_handles.into_iter().flatten().collect();
@@ -1881,7 +1881,7 @@ fn evaluate_word_parts(
18811881
eval_glob: EvaluateGlob,
18821882
stdin: ShellPipeReader,
18831883
stderr: ShellPipeWriter,
1884-
) -> LocalBoxFuture<Result<WordPartsResult, EvaluateWordTextError>> {
1884+
) -> LocalBoxFuture<'_, Result<WordPartsResult, EvaluateWordTextError>> {
18851885
fn text_parts_to_string(parts: Vec<TextPart>) -> String {
18861886
let mut result =
18871887
String::with_capacity(parts.iter().map(|p| p.as_str().len()).sum());
@@ -1992,7 +1992,8 @@ fn evaluate_word_parts(
19921992
state: &mut ShellState,
19931993
stdin: ShellPipeReader,
19941994
stderr: ShellPipeWriter,
1995-
) -> LocalBoxFuture<Result<WordPartsResult, EvaluateWordTextError>> {
1995+
) -> LocalBoxFuture<'_, Result<WordPartsResult, EvaluateWordTextError>>
1996+
{
19961997
// recursive async, so requires boxing
19971998
async move {
19981999
let mut result = WordPartsResult::new(Vec::new(), Vec::new());

crates/shell/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ windows-sys = { version = "0.59.0", features = ["Win32_Foundation", "Win32_Syste
4343
ctrlc = "3.4.5"
4444
libc = "0.2.170"
4545

46+
[dev-dependencies]
47+
tempfile = "3.14.0"
48+
4649
[package.metadata.release]
4750
# Dont publish the binary
4851
release = false

crates/shell/pixi.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[workspace]
2+
authors = ["The prefix-dev/shell team <hi@prefix.dev>"]
3+
channels = ["conda-forge"]
4+
name = "shell"
5+
platforms = ["win-64"]
6+
version = "0.3.0"
7+
preview = ["pixi-build"]
8+
9+
[dependencies]
10+
rust = ">=1.90.0,<1.91"
11+
12+
[package]
13+
name = "shell"
14+
version = "0.3.0"
15+
16+
[package.build.backend]
17+
name = "pixi-build-rust"
18+
version = "==0.4.1"

0 commit comments

Comments
 (0)