Closed ImperatorS79 closed 4 years ago
I don't think that this will work. If the second install()
is removed, you will not be able to change the Wine version for an existing prefix (iirc).
The change is fine for me. I'm thinking if we shouldn't change
if (fileExists(workingContainerDirectory)) {
const containerConfiguration = configFactory.open(workingContainerDirectory + "/phoenicis.cfg");
distribution = containerConfiguration.readValue("wineDistribution", "upstream");
architecture = containerConfiguration.readValue("wineArchitecture", "x86");
const operatingSystem = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage();
subCategory = distribution + "-" + operatingSystem + "-" + architecture;
version = containerConfiguration.readValue("wineVersion");
this.install(subCategory, version);
} else {
print('Wine prefix "' + this.getWorkingContainer() + '" does not exist!');
return "";
}
to
if (!fileExists(workingContainerDirectory)) {
print('Wine prefix "' + this.getWorkingContainer() + '" does not exist!');
return "";
}
const containerConfiguration = configFactory.open(workingContainerDirectory + "/phoenicis.cfg");
distribution = containerConfiguration.readValue("wineDistribution", "upstream");
architecture = containerConfiguration.readValue("wineArchitecture", "x86");
const operatingSystem = operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage();
subCategory = distribution + "-" + operatingSystem + "-" + architecture;
version = containerConfiguration.readValue("wineVersion");
this.install(subCategory, version);
Might be clearer. What do you think?
if (!fileExists(workingContainerDirectory)) {
print('Wine prefix "' + this.getWorkingContainer() + '" does not exist!');
return "";
}
Should we maybe throw an error/exception instead if this case occurs?
Yes.
There are issues in Codacy.
@ImperatorS79 this PR has a merge conflict.
@madoar you have requested changes. Have they been addressed? If so, can we merge this?
There is still the new
in throw new Error(...);
missing.
@ImperatorS79 can you fix that?
@madoar please review again.
Description
If we get there the this.install has already been called
Ready for review
json-align
andeslint
run according to the documentation.