Skip to content

fnm@1.38.1: Remove leftovers when uninstall --purge, set FNM_DIR, persist some data#6070

Merged
Lutra-Fs merged 11 commits into
ScoopInstaller:masterfrom
o-l-a-v:fnm-add-purge-uninstall
Aug 13, 2025
Merged

fnm@1.38.1: Remove leftovers when uninstall --purge, set FNM_DIR, persist some data#6070
Lutra-Fs merged 11 commits into
ScoopInstaller:masterfrom
o-l-a-v:fnm-add-purge-uninstall

Conversation

@o-l-a-v

@o-l-a-v o-l-a-v commented Aug 3, 2024

Copy link
Copy Markdown
Contributor

Changes

  • Purge will remove more leftovers of fnm.
    • Directories.
      • %LOCALAPPDATA%\fnm_multishells.
      • %APPDATA%\fnm.
    • Environment variables starting with FNM_.
  • Will set environment variable FNM_DIR to Scoop $dir.
  • Persist $dir\aliases and $dir\node-versions because of FNM_DIR.

More about purge of directories

fnm leaves behind two directories when uninstalled:

  • %LOCALAPPDATA%\fnm_multishells
  • %APPDATA%\fnm

This PR adds the ability to have them nuked when uninstall --purge.

Note: For some reason [System.IO.Directory]::Delete() failed to delete one of the directories with an error about access denied, but Remove-Item -Recurse worked. So I'm using Remove-Item -Recurse.

Contributing guidelines

@github-actions

github-actions Bot commented Aug 3, 2024

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

fnm

  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

@o-l-a-v o-l-a-v changed the title fnm: Remove leftovers when uninstall --purge fnm@1.37.2: Remove leftovers when uninstall --purge Oct 9, 2024
@o-l-a-v o-l-a-v changed the title fnm@1.37.2: Remove leftovers when uninstall --purge fnm@1.38.1: Remove leftovers when uninstall --purge Nov 19, 2024
@o-l-a-v

o-l-a-v commented Dec 27, 2024

Copy link
Copy Markdown
Contributor Author

/verify

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

fnm

  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

@o-l-a-v

o-l-a-v commented Jun 27, 2025

Copy link
Copy Markdown
Contributor Author

/verify

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

fnm

  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

@Lutra-Fs

Lutra-Fs commented Aug 12, 2025

Copy link
Copy Markdown
Member

I guess we should set FNM_DIR up as well. See https://github.com/Schniz/fnm/blob/1ebc90decf58c2176dcbd4f8ac00ecb3adb1de12/docs/commands.md?plain=1#L33
and possibly add related persist option. It will affect %APPDATA%\fnm but we still need to handle %LOCALAPPDATA%\fnm_multishells

@o-l-a-v

o-l-a-v commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

I (think I) added your suggestions @Lutra-Fs.

  • Setting env variable FNM_DIR
  • Persist aliases and node-versions directories
  • Purge will remove any FNM_* environment variables

What you think? 😊

@o-l-a-v

o-l-a-v commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

/verify

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

fnm

  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

@Lutra-Fs

Lutra-Fs commented Aug 13, 2025

Copy link
Copy Markdown
Member

I'll spin up a VM to install the updated manifest, try a couple of small projects, and then uninstall. If everything looks good, I'll go ahead and merge. One question: since the manifest uses env_set, do we also need to explicitly unset those variables in the post_uninstall script, or does Scoop handle cleanup automatically? I'm checking the source now to confirm.

@Lutra-Fs

Lutra-Fs commented Aug 13, 2025

Copy link
Copy Markdown
Member

Can you kindly add a note to tell the user that the new config location will be under our directory? See #6462 (comment) for an example.

@o-l-a-v

o-l-a-v commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

/verify

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

fnm

  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

@o-l-a-v o-l-a-v changed the title fnm@1.38.1: Remove leftovers when uninstall --purge fnm@1.38.1: Remove leftovers when uninstall --purge, set FNM_DIR, persist some data Aug 13, 2025
@o-l-a-v

o-l-a-v commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

One potential problem is that FNM_DIR is not set in current session / process after scoop install fnm. Related:

I'll add info on that too.

@o-l-a-v

o-l-a-v commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

Worked around it by setting $env:FNM_HOME in post_install.

@o-l-a-v

o-l-a-v commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

/verify

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

fnm

  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

@o-l-a-v

o-l-a-v commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

/verify

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

fnm

  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Comment thread bucket/fnm.json
@Lutra-Fs

Copy link
Copy Markdown
Member

NVM, just noticed that you have fixed it. Reviewing the wrong version of the code 😢

@Lutra-Fs Lutra-Fs merged commit 017b270 into ScoopInstaller:master Aug 13, 2025
2 checks passed
@o-l-a-v o-l-a-v deleted the fnm-add-purge-uninstall branch August 13, 2025 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants