Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ac948f193b | |||
| 2d7d6cf641 |
10
CHANGELOG.md
10
CHANGELOG.md
@@ -2,12 +2,22 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [1.3.1] - 2025-01-31
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
- Better enforce typing for commands
|
||||
|
||||
## [1.3.0] - 2025-01-31
|
||||
|
||||
### 🚀 Features
|
||||
|
||||
- Pipe
|
||||
|
||||
### ⚙️ Miscellaneous Tasks
|
||||
|
||||
- Release
|
||||
|
||||
## [1.2.0] - 2025-01-14
|
||||
|
||||
### 🚀 Features
|
||||
|
||||
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -40,7 +40,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "comlexr"
|
||||
version = "1.3.0"
|
||||
version = "1.3.1"
|
||||
dependencies = [
|
||||
"comlexr_macro",
|
||||
"rstest",
|
||||
@@ -51,7 +51,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "comlexr_macro"
|
||||
version = "1.3.0"
|
||||
version = "1.3.1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
||||
@@ -4,7 +4,7 @@ members = ["macro"]
|
||||
[workspace.package]
|
||||
description = "Dynamically build Command objects with conditional expressions"
|
||||
repository = "https://gitlab.com/wunker-bunker/comlexr"
|
||||
version = "1.3.0"
|
||||
version = "1.3.1"
|
||||
edition = "2021"
|
||||
rust-version = "1.60"
|
||||
license = "MIT"
|
||||
@@ -43,7 +43,7 @@ pre-release-replacements = [
|
||||
all-features = true
|
||||
|
||||
[dependencies]
|
||||
comlexr_macro = { version = "=1.3.0", path = "./macro" }
|
||||
comlexr_macro = { version = "=1.3.1", path = "./macro" }
|
||||
thiserror = "1.0.65"
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -8,7 +8,7 @@ Add `comlexr` to your project's `Cargo.toml`:
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
comlexr = "1.3.0"
|
||||
comlexr = "1.3.1"
|
||||
```
|
||||
|
||||
## MSRV
|
||||
|
||||
@@ -6,7 +6,7 @@ use syn::{
|
||||
Error, Token,
|
||||
};
|
||||
|
||||
use crate::{cmd::Value, macros::enum_to_tokens};
|
||||
use crate::cmd::Value;
|
||||
|
||||
pub struct Pipe {
|
||||
stdin: Option<Value>,
|
||||
@@ -47,7 +47,7 @@ impl ToTokens for Pipe {
|
||||
let first_command = commands_iter.next().unwrap();
|
||||
|
||||
let initial = quote! {
|
||||
let mut _c_0 = #first_command;
|
||||
let mut _c_0: #first_command;
|
||||
_c_0.stdout(::std::process::Stdio::piped());
|
||||
_c_0.stdin(::std::process::Stdio::piped());
|
||||
let mut _child_0 = _c_0.spawn()?;
|
||||
@@ -95,7 +95,7 @@ impl ToTokens for Pipe {
|
||||
});
|
||||
}
|
||||
|
||||
let mut #com_ident = #command;
|
||||
let mut #com_ident: #command;
|
||||
#com_ident.stdout(::std::process::Stdio::piped());
|
||||
#com_ident.stdin(::std::process::Stdio::piped());
|
||||
|
||||
@@ -171,4 +171,21 @@ impl Parse for CommandExpr {
|
||||
}
|
||||
}
|
||||
|
||||
enum_to_tokens! {CommandExpr: Macro, Reference, Function, Block}
|
||||
impl ToTokens for CommandExpr {
|
||||
fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) {
|
||||
tokens.extend(match self {
|
||||
Self::Macro(macr) => quote! {
|
||||
::std::process::Command = #macr
|
||||
},
|
||||
Self::Reference(refer) => quote! {
|
||||
&mut ::std::process::Command = #refer
|
||||
},
|
||||
Self::Function(fun) => quote! {
|
||||
::std::process::Command = #fun
|
||||
},
|
||||
Self::Block(block) => quote! {
|
||||
::std::process::Command = #block
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user