Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
27 changes: 0 additions & 27 deletions src/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand All @@ -25,31 +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 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)?;
Expand Down
Loading