Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 4a4ae32

Browse files
author
Anna Kocheshkova
authored
Added fix for post install script; (#360)
It uses indexOf instead of includes due to issues with some clients.
1 parent 6394681 commit 4a4ae32

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

hooks/beforeInstall.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
console.log("Cordova version is " + cordovaVersion);
2121

2222
var plugins = execSync(cordovaCLI + ' plugin ls');
23-
if (!plugins.includes('cordova-plugin-file-transfer')) {
23+
24+
if (plugins.indexOf('cordova-plugin-file-transfer') < 0) {
2425
if (parseFloat(cordovaVersion) < 6.3) {
25-
if (!plugins.includes('cordova-plugin-file')) {
26+
if (plugins.indexOf('cordova-plugin-file') < 0) {
2627
console.log("Installing the compatible version of file plugin... ");
2728
execSync(cordovaCLI + ' plugin add [email protected]');
2829
}
@@ -38,7 +39,7 @@
3839
}
3940
}
4041
}
41-
if (!plugins.includes('cordova-plugin-zip')) {
42+
if (plugins.indexOf('cordova-plugin-zip') < 0) {
4243
try {
4344
execSync(cordovaCLI + ' plugin add cordova-plugin-zip');
4445
} catch (e) {

0 commit comments

Comments
 (0)