Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Improve manifest "persist" #6179

Open
milnak opened this issue Oct 10, 2024 · 1 comment
Open

[Feature] Improve manifest "persist" #6179

milnak opened this issue Oct 10, 2024 · 1 comment

Comments

@milnak
Copy link

milnak commented Oct 10, 2024

Feature Request

Is your feature request related to a problem? Please describe.

Manifest "persist" assumes the object to be persisted is a folder, and very often its not.

    "persist": [
        "state.bin",
        "folder"
    ]

because of this, almost every manifest forces an empty file to be created, e.g.

    "pre_install": [
        "'state.bin' | ForEach-Object { New-Item -Path (Join-Path -Path $dir -ChildPath $_) -ItemType File -ErrorAction SilentlyContinue | Out-Null }"
    ],

Describe the solution you'd like

would be great to be able to optionally specify a type, e.g.

    "persist": [
        { "state.bin", "File" },
        { "folder", "Directory" }
    ]

and therefore, scoop wouldn't need to have a pre-existing object in the $dir folder.

Describe alternatives you've considered

29039 added a commit to 29039/Nirsoft that referenced this issue Nov 20, 2024
Persisting is presuming a directory not a file, needs this workaround to make it work, as per: ScoopInstaller/Scoop#6179
@29039
Copy link

29039 commented Nov 20, 2024

Honestly I would consider this a bug not an enhancement. The persist function is outright broken when the file to be persisted is a file not a folder.

The persist function needs to be corrected to be able to specify if the file is supposed to be a file or folder to avoid this "stupid but it works" workaround.

rasa pushed a commit to ScoopInstaller/Nirsoft that referenced this issue Nov 22, 2024
Persisting is presuming a directory not a file, needs this workaround to make it work, as per: ScoopInstaller/Scoop#6179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants