Skip to content

Commit a7bd372

Browse files
committed
Include Rust's license
Note: 提案自体としては前々から入れていた。
1 parent aff49a7 commit a7bd372

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

xtask/src/main.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,13 @@ fn gen_license_urls(ArgsGenLicenseUrls {}: ArgsGenLicenseUrls) -> eyre::Result<(
146146
})
147147
.collect::<eyre::Result<_>>()?;
148148

149-
for url in reorder(urls, &root_package.manifest_path)? {
150-
println!("{url}");
151-
}
149+
println!(
150+
"{}",
151+
Template {
152+
crate_licenses: reorder(urls, &root_package.manifest_path)?.collect(),
153+
}
154+
.render()?,
155+
);
152156
return Ok(());
153157

154158
fn read_git_sha1(manifest_dir: &Utf8Path) -> eyre::Result<String> {
@@ -167,6 +171,12 @@ fn gen_license_urls(ArgsGenLicenseUrls {}: ArgsGenLicenseUrls) -> eyre::Result<(
167171
sha1: String,
168172
}
169173
}
174+
175+
#[derive(askama::Template)]
176+
#[template(path = "./license-url.txt")]
177+
struct Template {
178+
crate_licenses: Vec<String>,
179+
}
170180
}
171181

172182
fn normal_crates_io_deps(

xtask/templates/license-url.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://www.rust-lang.org/ja/policies/licenses
2+
3+
{{ crate_licenses|join("\n") }}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy