cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [1/3] git commit: Make PLUGIN_SEARCH_PATH in createproject.sh more robust
Date Thu, 15 May 2014 18:21:48 GMT
Repository: cordova-app-harness
Updated Branches:
  refs/heads/master e310de3c8 -> 1fc7bf4a5


Make PLUGIN_SEARCH_PATH in createproject.sh more robust


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/f02bf4eb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/f02bf4eb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/f02bf4eb

Branch: refs/heads/master
Commit: f02bf4ebd81a0a1a6a51d49c01a22b7daa76ae2d
Parents: e310de3
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Thu May 15 13:51:04 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Thu May 15 13:51:04 2014 -0400

----------------------------------------------------------------------
 createproject.sh | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/f02bf4eb/createproject.sh
----------------------------------------------------------------------
diff --git a/createproject.sh b/createproject.sh
index fdb6c6e..7e751d4 100755
--- a/createproject.sh
+++ b/createproject.sh
@@ -38,9 +38,17 @@ DIR_NAME="${1}"
 AH_PATH="$(cd $(dirname $0) && pwd)"
 extra_search_path="$PLUGIN_SEARCH_PATH"
 PLUGIN_SEARCH_PATH="$(dirname "$AH_PATH")"
-if [[ -d $(dirname "$AH_PATH")/cordova-plugins ]]; then
-    PLUGIN_SEARCH_PATH="$PLUGIN_SEARCH_PATH:$(dirname "$AH_PATH")/cordova-plugins"
-fi
+
+function AddSearchPathIfExists() {
+    if [[ -d "$1" ]]; then
+        PLUGIN_SEARCH_PATH="$PLUGIN_SEARCH_PATH:$1"
+    fi
+}
+AddSearchPathIfExists "$(dirname "$AH_PATH")/cordova"
+AddSearchPathIfExists "$(dirname "$AH_PATH")/cordova/cordova-plugins"
+AddSearchPathIfExists "$(dirname "$AH_PATH")/cordova-plugins"
+AddSearchPathIfExists "$(dirname "$AH_PATH")/mobile-chrome-apps/chrome-cordova/plugins"
+
 if [[ -n "$extra_search_path" ]]; then
     PLUGIN_SEARCH_PATH="${extra_search_path}:$PLUGIN_SEARCH_PATH"
 fi


Mime
View raw message