From 70b1f84caa6cc3bd8280d4c4c1ec032548e25b3c Mon Sep 17 00:00:00 2001 From: Sienna Meridian Satterwhite Date: Sun, 5 Apr 2026 20:20:38 +0100 Subject: [PATCH] fix(config): delete legacy ~/.sunbeam.json after migration The migration from ~/.sunbeam.json to ~/.sunbeam/config.json copied but never removed the legacy file, which could cause confusion with older binaries still writing to the old path. --- src/config.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index 9a579ab7..3c3efd3f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,4 +1,4 @@ -use crate::error::{Result, ResultExt, SunbeamError}; +use crate::error::{Result, ResultExt}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::path::PathBuf; @@ -126,6 +126,7 @@ pub fn load_config() -> SunbeamConfig { let _ = std::fs::create_dir_all(parent); } if std::fs::copy(&legacy, &path).is_ok() { + let _ = std::fs::remove_file(&legacy); crate::output::ok(&format!( "Migrated config: {} → {}", legacy.display(), @@ -176,7 +177,7 @@ pub fn load_config() -> SunbeamConfig { config } -/// Save configuration to ~/.sunbeam.json. +/// Save configuration to ~/.sunbeam/config.json. pub fn save_config(config: &SunbeamConfig) -> Result<()> { let path = config_path(); if let Some(parent) = path.parent() {