2024-06-20 02:42:33 +09:00
|
|
|
mod v20240701;
|
2024-06-20 02:07:34 +09:00
|
|
|
|
2024-06-20 02:42:33 +09:00
|
|
|
use super::ConfigVersion;
|
2024-06-20 02:07:34 +09:00
|
|
|
|
|
|
|
#[derive(thiserror::Error, Debug)]
|
2024-06-20 02:42:33 +09:00
|
|
|
pub(crate) enum ConfigMigrateError {
|
2024-06-20 02:07:34 +09:00
|
|
|
#[error("failed to parse the old config file (.config/default.yml)")]
|
2024-06-20 02:42:33 +09:00
|
|
|
ReadOldConfig(#[from] v20240701::ReadYamlConfigError),
|
2024-06-20 02:07:34 +09:00
|
|
|
}
|
|
|
|
|
2024-06-20 02:42:33 +09:00
|
|
|
pub(super) fn run(version: ConfigVersion) -> Result<(), ConfigMigrateError> {
|
|
|
|
match version {
|
|
|
|
ConfigVersion::V20240701 => v20240701::run()?,
|
2024-06-20 02:07:34 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|