From fe84519bede9a53c08326ae53ab6ea7b31cfbbe1 Mon Sep 17 00:00:00 2001 From: Risu <79110363+risu729@users.noreply.github.com> Date: Thu, 28 Aug 2025 12:45:24 +1000 Subject: [PATCH 1/2] fix: remove nodejs/golang alias migrate code --- docs/faq.md | 9 --------- src/migrate.rs | 8 -------- 2 files changed, 17 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index ad23d982e1..64f7c7a9fc 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -24,15 +24,6 @@ something with the aliasing is acting up, submit a ticket or just stick to using Under the hood, when mise reads a config file or takes CLI input it will swap out "nodejs" and "golang". -While this change is rolling out, there is some migration code that will move installs/plugins from -the "nodejs" and "golang" directories to the new names. If this runs for you you'll see a message -but it should not run again unless there is some kind of problem. In this case, it's probably -easiest to just -run -`rm -rf ~/.local/share/mise/installs/{golang,nodejs} ~/.local/share/mise/plugins/{golang,nodejs}`. - -Once most users have migrated over this migration code will be removed. - ## What does `mise activate` do? It registers a shell hook to run `mise hook-env` every time the shell prompt is displayed. diff --git a/src/migrate.rs b/src/migrate.rs index 301496f8ab..a5fb6c71b7 100644 --- a/src/migrate.rs +++ b/src/migrate.rs @@ -7,8 +7,6 @@ use eyre::Result; pub async fn run() { tokio::join!( - task(|| rename_plugin("nodejs", "node")), - task(|| rename_plugin("golang", "go")), task(migrate_trusted_configs), task(migrate_tracked_configs), task(|| remove_deprecated_plugin("node", "rtx-nodejs")), @@ -44,12 +42,6 @@ fn move_subdirs(from: &Path, to: &Path) -> Result<()> { Ok(()) } -fn rename_plugin(from: &str, to: &str) -> Result<()> { - move_subdirs(&INSTALLS.join(from), &INSTALLS.join(to))?; - move_subdirs(&PLUGINS.join(from), &PLUGINS.join(to))?; - Ok(()) -} - fn migrate_tracked_configs() -> Result<()> { move_dirs(&DATA.join("tracked_config_files"), &TRACKED_CONFIGS)?; move_dirs(&DATA.join("tracked-config-files"), &TRACKED_CONFIGS)?; From fc3127266c9ac005ffd3f1ad14a8b2cb946c503a Mon Sep 17 00:00:00 2001 From: Risu <79110363+risu729@users.noreply.github.com> Date: Thu, 28 Aug 2025 13:35:03 +1000 Subject: [PATCH 2/2] fix: remove unused code --- src/migrate.rs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/migrate.rs b/src/migrate.rs index a5fb6c71b7..bac3b1510b 100644 --- a/src/migrate.rs +++ b/src/migrate.rs @@ -23,25 +23,6 @@ async fn task(job: impl FnOnce() -> Result<()> + Send + 'static) { } } -fn move_subdirs(from: &Path, to: &Path) -> Result<()> { - if from.exists() { - eprintln!("migrating {} to {}", from.display(), to.display()); - file::create_dir_all(to)?; - for f in from.read_dir()? { - let f = f?.file_name(); - let from_file = from.join(&f); - let to_file = to.join(&f); - if !to_file.exists() { - eprintln!("moving {} to {}", from_file.display(), to_file.display()); - file::rename(from_file, to_file)?; - } - } - file::remove_all(from)?; - } - - Ok(()) -} - fn migrate_tracked_configs() -> Result<()> { move_dirs(&DATA.join("tracked_config_files"), &TRACKED_CONFIGS)?; move_dirs(&DATA.join("tracked-config-files"), &TRACKED_CONFIGS)?;