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

Update tahoma and mfc42 verb: use fileExists #1116

Merged
merged 29 commits into from
Nov 28, 2019
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
06ad52f
Merge pull request #1 from PhoenicisOrg/master
ImperatorS79 Aug 28, 2017
86fd07c
Update script.js
ImperatorS79 Aug 28, 2017
a6f232b
Merge pull request #2 from PhoenicisOrg/master
ImperatorS79 Aug 28, 2017
a80aa84
Merge pull request #3 from PhoenicisOrg/master
ImperatorS79 Sep 26, 2017
6da4a59
Merge pull request #4 from PhoenicisOrg/master
ImperatorS79 Mar 19, 2018
4a11f65
Merge pull request #8 from PhoenicisOrg/master
ImperatorS79 Apr 9, 2018
b2d5724
Merge pull request #9 from PhoenicisOrg/master
ImperatorS79 May 7, 2018
b7d1f0f
Merge pull request #10 from PhoenicisOrg/master
ImperatorS79 May 13, 2018
533df6e
Merge pull request #11 from PhoenicisOrg/master
ImperatorS79 May 22, 2018
186e4ed
Merge pull request #12 from PhoenicisOrg/master
ImperatorS79 May 29, 2018
99cf1db
Merge pull request #13 from PhoenicisOrg/master
ImperatorS79 Jun 13, 2018
87999b4
Merge pull request #15 from PhoenicisOrg/master
ImperatorS79 Oct 10, 2018
610b258
Merge pull request #16 from PhoenicisOrg/master
ImperatorS79 Oct 12, 2018
ad2ea01
Merge pull request #17 from PhoenicisOrg/master
ImperatorS79 Jan 12, 2019
2e53a22
Merge pull request #18 from PhoenicisOrg/master
ImperatorS79 Jan 18, 2019
10f93ca
Merge pull request #20 from PhoenicisOrg/master
ImperatorS79 Feb 2, 2019
ade899d
Merge pull request #21 from PhoenicisOrg/master
ImperatorS79 Feb 27, 2019
db6e1b9
Merge pull request #23 from PhoenicisOrg/master
ImperatorS79 May 9, 2019
da1a517
Merge pull request #26 from PhoenicisOrg/master
ImperatorS79 May 20, 2019
72863e6
Merge pull request #28 from PhoenicisOrg/master
ImperatorS79 Jun 2, 2019
f812551
Merge pull request #33 from PhoenicisOrg/master
ImperatorS79 Aug 24, 2019
a3f62ce
Update script.js
ImperatorS79 Aug 24, 2019
d3ab4e2
Update script.js
ImperatorS79 Sep 6, 2019
276da5b
Update script.js
ImperatorS79 Sep 7, 2019
9d34f45
Update script.js
ImperatorS79 Sep 9, 2019
d842fae
Merge branch 'master' into file-exists
ImperatorS79 Sep 10, 2019
3d71e50
Merge pull request #36 from PhoenicisOrg/master
ImperatorS79 Nov 26, 2019
b21f5af
Update script.js
ImperatorS79 Nov 28, 2019
2d1b2aa
Update script.js
ImperatorS79 Nov 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Engines/Wine/Verbs/Tahoma/script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Wine = include("engines.wine.engine.object");
const Resource = include("utils.functions.net.resource");
const { cp } = include("utils.functions.filesystem.files");
const { cp, fileExists, mkdir } = include("utils.functions.filesystem.files");
const { CabExtract } = include("utils.functions.filesystem.extract");

const Optional = Java.type("java.util.Optional");
Expand All @@ -19,6 +19,10 @@ class Tahoma {
const wizard = this.wine.wizard();
const prefixDirectory = this.wine.prefixDirectory();
const fontDirectory = this.wine.fontDirectory();

if (!fileExists(fontDirectory)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name sounds strange in this case. Should we add a dedicated method for folders? What do you think @plata @ImperatorS79?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do that. Would basically be an alias then, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I'm not sure. If we decide to split the functionality into a fileExists and directoryExists method we could also test whether the given path is not a file/directory but instead a directory/file, depending on the regarded method.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable.

mkdir(fontDirectory);
}

const tahoma = new Resource()
.wizard(wizard)
Expand Down
12 changes: 8 additions & 4 deletions Engines/Wine/Verbs/mfc42/script.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const Wine = include("engines.wine.engine.object");
const Resource = include("utils.functions.net.resource");
const { CabExtract } = include("utils.functions.filesystem.extract");
const { remove } = include("utils.functions.filesystem.files");
const { fileExists, remove } = include("utils.functions.filesystem.files");

const Optional = Java.type("java.util.Optional");

Expand All @@ -25,9 +25,13 @@ class Mfc42 {
.checksum("a8c4dd33e281c166488846a10edf97ff0ce37044")
.name("VC6RedistSetup_deu.exe")
.get();

remove(`${system32directory}/mfc42.dll`);
remove(`${system32directory}/mfc42u.dll`);

if (fileExists(`${system32directory}/mfc42.dll`)) {
remove(`${system32directory}/mfc42.dll`);
}
if (fileExists(`${system32directory}/mfc42u.dll`)) {
remove(`${system32directory}/mfc42u.dll`);
}

new CabExtract()
.wizard(wizard)
Expand Down