|
1 | | -use log::{debug, error, warn, Level, LevelFilter, Log, Metadata, Record}; |
| 1 | +use log::{Level, LevelFilter, Log, Metadata, Record, debug, error, warn}; |
2 | 2 | use owo_colors::{OwoColorize, Style}; |
3 | 3 | use std::os::unix::fs::PermissionsExt; |
4 | 4 | use std::sync::mpsc; |
@@ -319,6 +319,24 @@ fn enqueue_github_workflow_jobs(sender: std::sync::mpsc::Sender<Job>) { |
319 | 319 | } |
320 | 320 | } |
321 | 321 |
|
| 322 | +static GITHUB_FUNDING_YML: &str = include_str!(".github/FUNDING.yml"); |
| 323 | + |
| 324 | +fn enqueue_github_funding_jobs(sender: std::sync::mpsc::Sender<Job>) { |
| 325 | + use std::fs; |
| 326 | + let funding_path = Path::new(".github/FUNDING.yml"); |
| 327 | + let old_content = fs::read(funding_path).ok(); |
| 328 | + let new_content = GITHUB_FUNDING_YML.as_bytes().to_vec(); |
| 329 | + let job = Job { |
| 330 | + path: funding_path.to_path_buf(), |
| 331 | + old_content, |
| 332 | + new_content, |
| 333 | + executable: false, |
| 334 | + }; |
| 335 | + if let Err(e) = sender.send(job) { |
| 336 | + error!("Failed to send GitHub funding job: {e}"); |
| 337 | + } |
| 338 | +} |
| 339 | + |
322 | 340 | static CARGO_HUSKY_PRECOMMIT_HOOK: &str = include_str!(".cargo-husky/hooks/pre-commit"); |
323 | 341 |
|
324 | 342 | fn enqueue_cargo_husky_precommit_hook_jobs(sender: std::sync::mpsc::Sender<Job>) { |
@@ -475,6 +493,13 @@ fn main() { |
475 | 493 | } |
476 | 494 | })); |
477 | 495 |
|
| 496 | + handles.push(std::thread::spawn({ |
| 497 | + let sender = tx_job.clone(); |
| 498 | + move || { |
| 499 | + enqueue_github_funding_jobs(sender); |
| 500 | + } |
| 501 | + })); |
| 502 | + |
478 | 503 | handles.push(std::thread::spawn({ |
479 | 504 | let sender = tx_job.clone(); |
480 | 505 | move || { |
|
0 commit comments