Skip to content

Reset command reverts the direction of symlinks #2828

Closed
@kimbirkelund

Description

It appears that after running reset once on an installed app the symlink is from the persist folder to the app and not the other way around.

Using rufus as an example (I've seen it with multiple apps) the following occurs.

  1. Uninstall rufus and delete persist folder
  2. Install rufus
    • Rufus is installed and persist folder contains rufus.ini and a folder rufus_files
  3. Run scoop reset rufus
    • Command runs successfully
    • Persist folder now contains the same
  4. Run scoop reset rufus again
    • Command runs successfully but writes "Cannot create a file when that file already exists."
    • Persist now contains rufus.ini and folder rufus_files as before, but rufus_files now contains a junction named rufus_files that points back to its parent (i.e. the rufus_files folder that was there already)
  5. Run scoop reset rufus again
    • Command fails with error: "Cannot create a file when that file already exists."
    • Persist folder is unchanged

The behavior it quite new and might very well coincide with PR #2773. However looking at the change in there and how persist_data is used elsewhere I cannot explain why the error would occur.

I've attached a transcript of my reproduction.

repro.txt

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions