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] Ability to use Variables like $version in persist parameter #4630

Closed
lenicyl opened this issue Jan 7, 2022 · 7 comments
Closed

Comments

@lenicyl
Copy link

lenicyl commented Jan 7, 2022

Feature Request

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

I was trying to make a manifest for Flow Launcher, however I had an issue while doing so.
Flow Launcher has a folder called app-[version], the screenshot below will help you relate to what im talking about. This folder contains a folder that i would like to be placed at persist

image

However since the folder name would change every update, that wouldnt really work unless I make use of some hacky post-install script.


Describe the solution you'd like

Ability to use variables like $version for persist parameter

Thanks.

@rashil2000
Copy link
Member

rashil2000 commented Jan 7, 2022

All properties except persist support substitution variables. For persist, I'm not sure as it needs to be consistent between different versions. @niheaven @issaclin32 is my assumption correct?

@niheaven
Copy link
Member

niheaven commented Jan 7, 2022

A long long ago PR solved this kind of persisting work: #3248.

@rashil2000 rashil2000 changed the title [Feature] Ability to use Variables like $version in more parameters [Feature] Ability to use Variables like $version in persist parameter Jan 7, 2022
@Ash258
Copy link
Contributor

Ash258 commented Jan 7, 2022

Scoop/lib/install.ps1

Lines 1149 to 1156 in 1dbab1f

$source, $target = persist_def $_
write-host "Persisting $source"
$source = $source.TrimEnd("/").TrimEnd("\\")
$source = fullpath "$dir\$source"
$target = fullpath "$persist_dir\$target"

persist:
- - app-1.9.1
  - appPersisted
autoupdate:
  persist: # Autoupdate should allow it
  - - app-$version
    - appPersisted 

@niheaven
Copy link
Member

niheaven commented Jan 7, 2022

Forget this basic usage. Autoupdate WILL update persist, as the following existed in autoupdateArch

Scoop/schema.json

Lines 221 to 223 in c864f68

"persist": {
"$ref": "#/definitions/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings"
},

@lenicyl
Copy link
Author

lenicyl commented Jan 7, 2022

Scoop/lib/install.ps1

Lines 1149 to 1156 in 1dbab1f

$source, $target = persist_def $_
write-host "Persisting $source"
$source = $source.TrimEnd("/").TrimEnd("\\")
$source = fullpath "$dir\$source"
$target = fullpath "$persist_dir\$target"

persist:
- - app-1.9.1
  - appPersisted
autoupdate:
  persist: # Autoupdate should allow it
  - - app-$version
    - appPersisted 

Thanks but since im trying to achieve "persist": "app-1.9.1\\UserData",
Using the persist in autoupdate wont really make sense since the UserData folder will be reset every update

@rashil2000
Copy link
Member

Thanks but since im trying to achieve "persist": "app-1.9.1\\UserData", Using the persist in autoupdate wont really make sense since the UserData folder will be reset every update

What they meant is that you can persist a folder using a different name - by specifying a source and a target in an array. That will help you persist across versions.

@lenicyl
Copy link
Author

lenicyl commented Jan 7, 2022

Oh, ok
Thanks for your help everyone

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

4 participants