Skip to content

Commit

Permalink
Merge pull request #1498 from messense/generate-ci-command
Browse files Browse the repository at this point in the history
Record `generate-ci` command arguments in generate configuration
  • Loading branch information
messense authored Feb 25, 2023
2 parents 7fda645 + d6497f2 commit 27ede0c
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,23 @@ impl GenerateCI {
| BridgeModel::Cffi
| BridgeModel::UniFfi
);
let gen_cmd = std::env::args()
.enumerate()
.map(|(i, arg)| {
if i == 0 {
env!("CARGO_PKG_NAME").to_string()
} else {
arg
}
})
.collect::<Vec<String>>()
.join(" ");
let mut conf = format!(
"# Generated by maturin v{version}
"# This file is autogenerated by maturin v{version}
# To update, run
#
# {gen_cmd}
#
on:
push:
branches:
Expand Down Expand Up @@ -429,7 +444,7 @@ mod tests {
.generate_github("example", &BridgeModel::Bindings("pyo3".to_string(), 7))
.unwrap()
.lines()
.skip(1)
.skip(5)
.collect::<Vec<_>>()
.join("\n");
let expected = indoc! {r#"
Expand Down Expand Up @@ -533,7 +548,7 @@ mod tests {
.generate_github("example", &BridgeModel::BindingsAbi3(3, 7))
.unwrap()
.lines()
.skip(1)
.skip(5)
.collect::<Vec<_>>()
.join("\n");
let expected = indoc! {r#"
Expand Down Expand Up @@ -642,7 +657,7 @@ mod tests {
.generate_github("example", &BridgeModel::Bindings("pyo3".to_string(), 7))
.unwrap()
.lines()
.skip(1)
.skip(5)
.collect::<Vec<_>>()
.join("\n");
let expected = indoc! {r#"
Expand Down Expand Up @@ -785,7 +800,7 @@ mod tests {
.generate_github("example", &BridgeModel::Bin(None))
.unwrap()
.lines()
.skip(1)
.skip(5)
.collect::<Vec<_>>()
.join("\n");
let expected = indoc! {r#"
Expand Down

0 comments on commit 27ede0c

Please sign in to comment.