From 05fc5bdbc49e6ad9810c9182ed53110677a71184 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 20 Jun 2024 12:47:56 +0900 Subject: [PATCH] WIP --- src/command/config/migrate/v20240701.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/command/config/migrate/v20240701.rs b/src/command/config/migrate/v20240701.rs index 90e0f57..ea0641c 100644 --- a/src/command/config/migrate/v20240701.rs +++ b/src/command/config/migrate/v20240701.rs @@ -2,6 +2,7 @@ //! use crate::config::{client, server}; +use color_print::cprintln; use sqlx::{postgres::PgConnectOptions, ConnectOptions}; use std::{ collections::HashMap, @@ -265,10 +266,9 @@ fn create_new_server_config( let repository_url = match meta.repository_url.as_ref() { "https://codeberg.org/calckey/calckey" | "https://codeberg.org/firefish/firefish" - | "https://git.joinfirefish.org/firefish/firefish" => { - "https://firefish.dev/firefish/firefish".to_owned() - } - url => url.to_owned(), + | "https://git.joinfirefish.org/firefish/firefish" + | "https://firefish.dev/firefish/firefish" => None, + url => Some(url.to_owned()), }; let mut server_config = server::Config { @@ -278,7 +278,7 @@ fn create_new_server_config( maintainer_name: meta.maintainer_name.to_owned(), contact_info: meta.maintainer_email.to_owned(), open_registrations: !meta.disable_registration, - repository_url: Some(repository_url), + repository_url, }), timelines: Some(server::Timelines { local: !meta.disable_local_timeline, @@ -444,6 +444,7 @@ pub(super) async fn run() -> Result<(), Error> { .as_bytes(), ) .map_err(WriteTomlConfigError::ServerWrite)?; + cprintln!("config/server.toml has been created!"); let mut client_toml = fs::File::create_new("config/client.toml").map_err(WriteTomlConfigError::ClientWrite)?; @@ -454,6 +455,7 @@ pub(super) async fn run() -> Result<(), Error> { .as_bytes(), ) .map_err(WriteTomlConfigError::ClientWrite)?; + cprintln!("config/client.toml has been created!"); Ok(()) }