summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2013-08-27 09:14:12 -0400
committerJoerg Bornemann <joerg.bornemann@digia.com>2013-08-30 11:44:07 +0200
commit8c67a5e6ffcb51a0a09748d18fb566a1d1478b84 (patch)
treeecdcca5585741f0fade3d9eacdcc1e179dcb01b2 /share
parent92ae89a2f7aee0c857062ada2a82af55e9153070 (diff)
downloadqbs-8c67a5e6ffcb51a0a09748d18fb566a1d1478b84.tar.gz
Improve plutil error handling.
Now the reason for failure will be shown to the user since plutil prints its error output to stdout instead of stderr. Change-Id: I19c9a455503f086fe9b52545a8793c580e6c42ac Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/modules/cpp/bundle-tools.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/share/qbs/modules/cpp/bundle-tools.js b/share/qbs/modules/cpp/bundle-tools.js
index 2913d8d1c..102bdcd22 100644
--- a/share/qbs/modules/cpp/bundle-tools.js
+++ b/share/qbs/modules/cpp/bundle-tools.js
@@ -30,6 +30,9 @@ function infoPlistContents(infoPlistFilePath)
var process = new Process();
process.start("plutil", ["-convert", "json", "-o", "-", infoPlistFilePath]);
process.waitForFinished();
+ if (process.exitCode() != 0)
+ throw("plutil: " + (process.readStdErr().trim() || process.readStdOut().trim()));
+
return JSON.parse(process.readStdOut());
}
@@ -42,14 +45,8 @@ function infoPlistFormat(infoPlistFilePath)
var process = new Process();
process.start("plutil", ["-lint", infoPlistFilePath]);
process.waitForFinished();
- var lint = process.readStdOut().trim();
- if (lint.indexOf(infoPlistFilePath + ": ") !== 0)
- throw("Unexpected output from plutil command: " + lint);
-
- lint = lint.slice(infoPlistFilePath.length + 2);
-
- if (lint !== "OK")
- throw("Info.plist was in an invalid format: " + lint);
+ if (process.exitCode() != 0)
+ throw("plutil: " + (process.readStdErr().trim() || process.readStdOut().trim()));
process = new Process();
process.start("file", [infoPlistFilePath]);