mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-10 18:27:18 +00:00
Remove unused automation code
This commit is contained in:
parent
992783ea15
commit
fd9b3794cf
@ -14,7 +14,6 @@ impl Args {
|
|||||||
#[derive(clap::Subcommand)]
|
#[derive(clap::Subcommand)]
|
||||||
pub enum Blog {
|
pub enum Blog {
|
||||||
Release,
|
Release,
|
||||||
SponsorUpdate,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(clap::Parser)]
|
#[derive(clap::Parser)]
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
mod release;
|
mod release;
|
||||||
mod sponsors;
|
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
pub use self::{
|
pub use self::release::create_release_announcement;
|
||||||
release::create_release_announcement, sponsors::create_sponsor_update,
|
|
||||||
};
|
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
use std::fmt::Write;
|
|
||||||
|
|
||||||
use tokio::{fs::File, io::AsyncWriteExt};
|
|
||||||
|
|
||||||
use super::util;
|
|
||||||
|
|
||||||
pub async fn create_sponsor_update() -> anyhow::Result<()> {
|
|
||||||
let month = util::now_ym();
|
|
||||||
let date = util::now_ymd();
|
|
||||||
|
|
||||||
let mut file = util::create_blog_post_file("sponsors", &month).await?;
|
|
||||||
generate_update(date, month, &mut file).await?;
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn generate_update(
|
|
||||||
date: String,
|
|
||||||
month: String,
|
|
||||||
file: &mut File,
|
|
||||||
) -> anyhow::Result<()> {
|
|
||||||
let mut buf = String::new();
|
|
||||||
write!(
|
|
||||||
buf,
|
|
||||||
"\
|
|
||||||
+++
|
|
||||||
title = \"Sponsor Update - {month}\"
|
|
||||||
date = {date}
|
|
||||||
|
|
||||||
# Uncomment to generate the HTML for the email newsletter.
|
|
||||||
# template = \"newsletter/email.html\"
|
|
||||||
+++
|
|
||||||
|
|
||||||
Hey folks!
|
|
||||||
|
|
||||||
I just sent out the new sponsor update! Topics this month include:
|
|
||||||
|
|
||||||
- **TASK: Summarize sponsor update.**
|
|
||||||
|
|
||||||
If you want to receive monthly behind-the-scenes updates too, why not support Fornjot by [becoming a sponsor](https://github.com/sponsors/hannobraun)? You can start with as little as $2 a month. More substantial contributions are also welcome, of course 😁
|
|
||||||
|
|
||||||
I dedicate a substantial chunk of my week to working on Fornjot. Your contribution can help make that more sustainable.
|
|
||||||
|
|
||||||
|
|
||||||
### Not receiving these updates?
|
|
||||||
|
|
||||||
I've been sending out an update every month since February 2022. If you are a sponsor and haven't received those updates, maybe you are not opted in? Update your sponsorship over at GitHub, and make sure you check `Receive email updates from hannobraun`. Also make sure to check the spam folder in your email client.
|
|
||||||
|
|
||||||
If you still haven't received an update, [please contact me](mailto:hanno@braun-odw.eu). I'm happy to send you a copy directly.
|
|
||||||
|
|
||||||
I'm sorry for any inconvenience! Unfortunately, GitHub gives me no control over, or insight into, who is receiving those updates.
|
|
||||||
"
|
|
||||||
)?;
|
|
||||||
|
|
||||||
file.write_all(buf.as_bytes()).await?;
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
@ -4,11 +4,6 @@ use anyhow::Context;
|
|||||||
use chrono::{Datelike, Utc};
|
use chrono::{Datelike, Utc};
|
||||||
use tokio::fs::{self, File};
|
use tokio::fs::{self, File};
|
||||||
|
|
||||||
pub fn now_ym() -> String {
|
|
||||||
let now = Utc::now();
|
|
||||||
format!("{}-{:02}", now.year(), now.month())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn now_ymd() -> String {
|
pub fn now_ymd() -> String {
|
||||||
let now = Utc::now();
|
let now = Utc::now();
|
||||||
format!("{}-{:02}-{:02}", now.year(), now.month(), now.day())
|
format!("{}-{:02}-{:02}", now.year(), now.month(), now.day())
|
||||||
|
@ -26,11 +26,6 @@ pub async fn run() -> anyhow::Result<()> {
|
|||||||
.await
|
.await
|
||||||
.context("Failed to create release announcement")?;
|
.context("Failed to create release announcement")?;
|
||||||
}
|
}
|
||||||
Args::Blog(Blog::SponsorUpdate) => {
|
|
||||||
blog::create_sponsor_update()
|
|
||||||
.await
|
|
||||||
.context("Failed to create sponsor update")?;
|
|
||||||
}
|
|
||||||
Args::Sponsors(args) => {
|
Args::Sponsors(args) => {
|
||||||
let min_dollars = 8;
|
let min_dollars = 8;
|
||||||
let sponsors = Sponsors::query(&octocrab)
|
let sponsors = Sponsors::query(&octocrab)
|
||||||
|
Loading…
Reference in New Issue
Block a user