Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3BA99DA8B for ; Sat, 6 Oct 2012 00:45:51 +0000 (UTC) Received: (qmail 37052 invoked by uid 500); 6 Oct 2012 00:45:51 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 37021 invoked by uid 500); 6 Oct 2012 00:45:51 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 37014 invoked by uid 99); 6 Oct 2012 00:45:51 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Oct 2012 00:45:51 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D03D63AB5E; Sat, 6 Oct 2012 00:45:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: timkim@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: webworks commit: Added helper script to auto add webworks.js reference to html pages Message-Id: <20121006004550.D03D63AB5E@tyr.zones.apache.org> Date: Sat, 6 Oct 2012 00:45:50 +0000 (UTC) Updated Branches: refs/heads/master 446207993 -> 4a8f60dc4 Added helper script to auto add webworks.js reference to html pages Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/commit/4a8f60dc Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/tree/4a8f60dc Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/diff/4a8f60dc Branch: refs/heads/master Commit: 4a8f60dc46e4c234e4cf403fbea4cf1793413d92 Parents: 4462079 Author: Tim Kim Authored: Fri Oct 5 17:45:43 2012 -0700 Committer: Tim Kim Committed: Fri Oct 5 17:45:43 2012 -0700 ---------------------------------------------------------------------- bin/templates/project/cordova/addWebworks | 47 ++++++++++++++++++++++++ 1 files changed, 47 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/4a8f60dc/bin/templates/project/cordova/addWebworks ---------------------------------------------------------------------- diff --git a/bin/templates/project/cordova/addWebworks b/bin/templates/project/cordova/addWebworks new file mode 100755 index 0000000..f81b897 --- /dev/null +++ b/bin/templates/project/cordova/addWebworks @@ -0,0 +1,47 @@ +#! /bin/sh +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +ANT=$(which ant) + +if [ "$1" == "-h" -o "$1" == "-help" ] +then + echo 'usage: addWebworks' + echo 'Automatically adds the webworks.js reference to all of your html files in the www/ folder' + echo 'Only relevant to qnx' + exit 0 +fi + +if [ ! -e "www/js/webworks.js" ] +then + echo 'www/js/webworks.js file not found - need to build project' + $ANT qnx build +fi + +find www -name \*.html\* | while read fullpath +do + # i hate regex + jspath=$( dirname "$fullpath" ) ; jspath=${jspath#./www} ; jspath=${jspath//\/[a-zA-Z0-9]/../} ; jspath=${jspath//[a-zA-Z0-9]/} + sed -i "" '// a\ + ' $fullpath +done + +#find . -name \*.html\* -print0 | xargs -0 -I file sed -i "" '// a\ +#