From 208d83c89c6f17dc24521dea605112f1017f824c Mon Sep 17 00:00:00 2001 From: Brian Boyle Date: Thu, 20 Jun 2019 11:41:50 +0100 Subject: [PATCH] - Fixed merge issues --- intercom-plugin/scripts/checkForUpdate.js | 42 ++------------------- intercom-plugin/scripts/prepareCocoaPods.js | 12 +----- 2 files changed, 4 insertions(+), 50 deletions(-) diff --git a/intercom-plugin/scripts/checkForUpdate.js b/intercom-plugin/scripts/checkForUpdate.js index 69818c6..b53f4d5 100644 --- a/intercom-plugin/scripts/checkForUpdate.js +++ b/intercom-plugin/scripts/checkForUpdate.js @@ -1,12 +1,4 @@ -<<<<<<< HEAD var fs = require('fs'); -======= -function fetchUpdateInfo(context, callback) { - var fs = context.require('fs'); -<<<<<<< HEAD ->>>>>>> Fixing builds -======= ->>>>>>> 6589adde09224605ace925f9f1f6e29d5a94138e function fetchUpdateInfo(callback) { var updateInfo = { @@ -26,34 +18,20 @@ function fetchUpdateInfo(callback) { }); } -<<<<<<< HEAD -function writeUpdateInfo(updateInfo, callback) { -======= -function writeUpdateInfo(context, updateInfo, callback) { - var fs = context.require('fs'); -<<<<<<< HEAD ->>>>>>> Fixing builds -======= ->>>>>>> 6589adde09224605ace925f9f1f6e29d5a94138e +function writeUpdateInfo(updateInfo, callback) { fs.writeFile('platforms/ios/.intercom_update', JSON.stringify(updateInfo), 'utf8', function (err,data) { callback(); }); } -<<<<<<< HEAD function updateIntercomIfNeeded(updateInfo, callback) { var exec = require('child_process').exec; -======= -function updateIntercomIfNeeded(context, updateInfo, callback) { - var exec = context.require('child_process').exec; - ->>>>>>> Fixing builds var completion = function() { writeUpdateInfo(updateInfo, function() { callback(); }); }; - + if (updateInfo.releaseDate > updateInfo.podUpdateDate) { console.log("Updating Intercom"); exec('cd platforms/ios && pod update Intercom', function(error, stdout, stderr) { @@ -68,16 +46,8 @@ function updateIntercomIfNeeded(context, updateInfo, callback) { } } -<<<<<<< HEAD function fetchLatestRelease(callback) { var https = require('https'); -======= -function fetchLatestRelease(context, callback) { - var https = context.require('https'); -<<<<<<< HEAD ->>>>>>> Fixing builds -======= ->>>>>>> 6589adde09224605ace925f9f1f6e29d5a94138e var req = https.get({ headers: { @@ -106,15 +76,9 @@ function fetchLatestRelease(context, callback) { }); } -<<<<<<< HEAD module.exports = function() { var q = require('q'); var deferral = new q.defer(); -======= -module.exports = function(context) { - var Q = context.require('q'); - var deferral = new Q.defer(); ->>>>>>> Fixing builds fetchUpdateInfo(function(updateInfo) { // Check at most once every 48 hours @@ -123,7 +87,7 @@ module.exports = function(context) { updateInfo.lastCheckDate = Date.now(); if (releaseData != null) { - updateInfo.releaseDate = Date.parse(releaseData['published_at']); + updateInfo.releaseDate = Date.parse(releaseData['published_at']); } else { // last release date is unavailable, set it to today so that the pod is installed updateInfo.releaseDate = Date.now(); diff --git a/intercom-plugin/scripts/prepareCocoaPods.js b/intercom-plugin/scripts/prepareCocoaPods.js index 4a66939..5d3ea16 100644 --- a/intercom-plugin/scripts/prepareCocoaPods.js +++ b/intercom-plugin/scripts/prepareCocoaPods.js @@ -1,19 +1,9 @@ -<<<<<<< HEAD module.exports = function() { var q = require('q'); var exec = require('child_process').exec; var deferral = new q.defer(); -======= -module.exports = function(context) { - var Q = context.require('q'); - var deferral = new Q.defer(); - var exec = context.require('child_process').exec; -<<<<<<< HEAD ->>>>>>> Fixing builds -======= ->>>>>>> 6589adde09224605ace925f9f1f6e29d5a94138e - + console.log('Updating CocoaPods specs repo'); exec('pod repo update master', function(error, stdout, stderr) { deferral.resolve();