cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject android commit: CB-1809 `create` script should print out meaningful error messages
Date Tue, 06 Nov 2012 01:51:41 GMT
Updated Branches:
  refs/heads/master 69f11a29e -> ccdd2fd2c


CB-1809 `create` script should print out meaningful error messages


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/ccdd2fd2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/ccdd2fd2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/ccdd2fd2

Branch: refs/heads/master
Commit: ccdd2fd2ca86b355dd67466bb17ba00615ff0928
Parents: 69f11a2
Author: Anis Kadri <anis.kadri@gmail.com>
Authored: Mon Nov 5 17:51:32 2012 -0800
Committer: Anis Kadri <anis.kadri@gmail.com>
Committed: Mon Nov 5 17:51:32 2012 -0800

----------------------------------------------------------------------
 bin/create |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/ccdd2fd2/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index 71b912b..1bce739 100755
--- a/bin/create
+++ b/bin/create
@@ -66,12 +66,14 @@ function createAppInfoJar {
 }
 
 function on_error {
-    echo "An error occurred. Deleting project..."
+    echo "An unexpected error occurred: $previous_command exited with $?"
+    echo "Deleting project..."
     [ -d "$PROJECT_PATH" ] && rm -rf "$PROJECT_PATH"
+    exit "$?"
 }
 
 function replace {
-    local pattern=$1  
+    local pattern=$1
     local filename=$2
     # Mac OS X requires -i argument
     if [[ "$OSTYPE" =~ "darwin" ]]
@@ -84,6 +86,7 @@ function replace {
 }
 
 # we do not want the script to silently fail
+trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
 trap on_error ERR
 trap on_exit EXIT
 


Mime
View raw message