Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 61409200CBF for ; Sat, 24 Jun 2017 05:56:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 54D03160BF2; Sat, 24 Jun 2017 03:56:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9A0C8160BE5 for ; Sat, 24 Jun 2017 05:55:59 +0200 (CEST) Received: (qmail 84257 invoked by uid 500); 24 Jun 2017 03:55:58 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 84248 invoked by uid 99); 24 Jun 2017 03:55:58 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Jun 2017 03:55:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DFA39DFF61; Sat, 24 Jun 2017 03:55:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shazron@apache.org To: commits@cordova.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ios commit: CB-12948 - Add a warning to updateProject for iOS Date: Sat, 24 Jun 2017 03:55:56 +0000 (UTC) archived-at: Sat, 24 Jun 2017 03:56:00 -0000 Repository: cordova-ios Updated Branches: refs/heads/master 4490abf27 -> 17d6b8344 CB-12948 - Add a warning to updateProject for iOS This closes #322 Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/17d6b834 Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/17d6b834 Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/17d6b834 Branch: refs/heads/master Commit: 17d6b8344a8defc749b68e892fd7cb79b61f5752 Parents: 4490abf Author: Shazron Abdullah Authored: Fri Jun 23 17:57:48 2017 -0700 Committer: Shazron Abdullah Committed: Fri Jun 23 20:55:37 2017 -0700 ---------------------------------------------------------------------- bin/lib/create.js | 41 +++++++++++------------------------------ 1 file changed, 11 insertions(+), 30 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/17d6b834/bin/lib/create.js ---------------------------------------------------------------------- diff --git a/bin/lib/create.js b/bin/lib/create.js index 90de86a..4633381 100755 --- a/bin/lib/create.js +++ b/bin/lib/create.js @@ -23,7 +23,6 @@ var shell = require('shelljs'), Q = require ('q'), path = require('path'), fs = require('fs'), - plist = require('plist'), xmlescape = require('xml-escape'), ROOT = path.join(__dirname, '..', '..'), events = require('cordova-common').events; @@ -33,13 +32,6 @@ function updateSubprojectHelp() { console.log('Usage: CordovaVersion/bin/update_cordova_project path/to/your/app.xcodeproj [path/to/CordovaLib.xcodeproj]'); } -function setShellFatal(value, func) { - var oldVal = shell.config.fatal; - shell.config.fatal = value; - func(); - shell.config.fatal = oldVal; -} - function copyJsAndCordovaLib(projectPath, projectName, use_shared) { shell.cp('-f', path.join(ROOT, 'CordovaLib', 'cordova.js'), path.join(projectPath, 'www')); shell.cp('-rf', path.join(ROOT, 'cordova-js-src'), path.join(projectPath, 'platform_www')); @@ -173,17 +165,6 @@ function copyTemplateFiles(project_path, project_name, project_template_dir, pac shell.sed('-i', /--ID--/g, package_name, path.join(r, project_name+'-Info.plist')); } -function detectProjectName(projectDir) { - var files = fs.readdirSync(projectDir); - for (var i = 0; i < files.length; ++i) { - var m = /(.*)\.xcodeproj$/.exec(files[i]); - if (m) { - return m[1]; - } - } - throw new Error('Could not find an .xcodeproj directory within ' + projectDir); -} - function AbsParentPath(_path) { return path.resolve(path.dirname(_path)); } @@ -259,17 +240,17 @@ exports.createProject = function(project_path, package_name, project_name, opts) }; exports.updateProject = function(projectPath, opts) { - var projectName = detectProjectName(projectPath); - var project_template_dir = path.join(ROOT, 'bin', 'templates', 'project'); - //Get package_name from existing projectName-Info.plist file - var package_name = plist.parse(fs.readFileSync(path.join(projectPath, projectName, projectName+'-Info.plist'), 'utf8')).CFBundleIdentifier; - setShellFatal(true, function() { - copyTemplateFiles(projectPath, projectName, project_template_dir, package_name); - copyJsAndCordovaLib(projectPath, projectName, opts.link); - copyScripts(projectPath, projectName); - events.emit('log',generateDoneMessage('update', opts.link)); - }); - return Q.resolve(); + var errorString = + 'An in-place platform update is not supported. \n'+ + 'The `platforms` folder is always treated as a build artifact.\n' + + 'To update your platform, you have to remove, then add your ios platform again.\n' + + 'Make sure you save your plugins beforehand using `cordova plugin save`, and save a copy of the platform first if you had manual changes in it.\n' + + '\tcordova plugin save\n' + + '\tcordova platform rm ios\n' + + '\tcordova platform add ios\n' + ; + + return Q.reject(errorString); }; function generateDoneMessage(type, link) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org