From 3ba36e354e49f014bfd85bb8e21849d2184dccf3 Mon Sep 17 00:00:00 2001 From: Nicolas Naso Date: Fri, 16 Mar 2018 10:49:23 -0300 Subject: [PATCH 1/2] Check OS Checks if the OS is OSX (Darwin) before executing the hook --- scripts/after_plugin_add.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/after_plugin_add.js b/scripts/after_plugin_add.js index 4c9b49f..e47f458 100644 --- a/scripts/after_plugin_add.js +++ b/scripts/after_plugin_add.js @@ -2,6 +2,7 @@ var iosHelper = require("./lib/ios-helper"); var utilities = require("./lib/utilities"); +var os = require('os'); module.exports = function(context) { @@ -9,7 +10,7 @@ module.exports = function(context) { // Add a build phase which runs a shell script that executes the Crashlytics // run command line tool which uploads the debug symbols at build time. - if (platforms.indexOf("ios") !== -1) { + if (platforms.indexOf("ios") !== -1 && os.platform() === 'darwin') { var xcodeProjectPath = utilities.getXcodeProjectPath(context); iosHelper.removeShellScriptBuildPhase(context, xcodeProjectPath); iosHelper.addShellScriptBuildPhase(context, xcodeProjectPath); From 9e2a4dfafcf3259f09689374f390e03536f3ff00 Mon Sep 17 00:00:00 2001 From: Nicolas Naso Date: Fri, 16 Mar 2018 10:50:10 -0300 Subject: [PATCH 2/2] Checks OS Checks if the OS is OSX (Darwin) before executing the hook --- scripts/before_plugin_rm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/before_plugin_rm.js b/scripts/before_plugin_rm.js index 95fc238..9a9638d 100644 --- a/scripts/before_plugin_rm.js +++ b/scripts/before_plugin_rm.js @@ -2,13 +2,14 @@ var iosHelper = require("./lib/ios-helper"); var utilities = require("./lib/utilities"); +var os = require('os'); module.exports = function(context) { var platforms = context.opts.cordova.platforms; // Remove the build script that was added when the plugin was installed. - if (platforms.indexOf("ios") !== -1) { + if (platforms.indexOf("ios") !== -1 && os.platform() === 'darwin') { var xcodeProjectPath = utilities.getXcodeProjectPath(context); iosHelper.removeShellScriptBuildPhase(context, xcodeProjectPath); }