-
Notifications
You must be signed in to change notification settings - Fork 46
Change .environment to a function that returns variables instead of strings #1198
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
base: master
Are you sure you want to change the base?
Changes from all commits
254649c
63f898c
71cd3d8
60c3cb5
69e7bf2
5bf56fe
1c4fe31
66bd276
1791c28
9d473d3
afeb994
25b45d5
43932a3
8db0264
2cfd676
8b7a82a
b1b30ac
c21fb41
923f809
d3b3b61
dc204af
5bc1ecc
a508aa4
f0ad252
a04209e
fd04639
a2f712d
6b0df6c
7062364
082044e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,6 +130,8 @@ module.default = class SteamScript extends QuickScript { | |
.wizard(setupWizard) | ||
.prefix(this._name, this._wineDistribution, this._wineArchitecture, this._wineVersion); | ||
|
||
this._environment = this._environmentFunc(wine); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was this line added? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set the This PR still needs to add this behaviour for all There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer if we don't set the variable in object scope but in method scope, i.e.: const environment = this._environmentFunc(wine); If we do this we will need to forward There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is easier in terms of code change that we set it as object change (like it was done before using .environment() method). I guess it is a matter of personal opinion ^^. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you set everything in object scope you kind of polute the object. In my opinion an action should be repeatable. This means that if you call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You do not overwrite an existing value since _environment was not defined. If you run agian .go() you will overwrite that value, but since it can depend on the wine object it could potentially change, so this is not problem. Anyway I do not really care how it is done at this point, that is why I prefer the solution that needs the less code modifying/refactor. But you can do how you want. |
||
|
||
new Luna(wine).go(); | ||
new Corefonts(wine).go(); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not allow to pass the environment as a string also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because strings aren't directory paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I don't understand how it worked before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it never worked. Because I remember earlier today I did see nvapi workaround being enabled when using old
.environment
implementation.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It worked before because the envirnment was assumed to be a string not dependent of any external variable. With this, one can construct the environment with part depedending of wine or user input.
We could also add an option to just pass a plain string instead of a function in the case the string does not depends on wine or user input but it can be done with:
I think I prefer to use a uniform solution for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this, but I'm not sure I agree in this case.
Adding a second input type is as simple as adding another
else if
to the.environment(...)
implementation. The benefit of this is that you:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it is a question of choice. It does not bother me the way I propose it and it is not really that big (in comparaison of .postInstall or .preInstall generally). Always using a lambda function makes the code easier to write I guess (only one way to use and to code).
But if @Zemogiter is motivated ^^.