Skip to content

Commit 54e9352

Browse files
authored
Merge pull request #380 from ethereum/exitError
Exit with error code on error.
2 parents 0f0307d + a25f2be commit 54e9352

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

solcjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ var output = JSON.parse(solc.compileStandardWrapper(JSON.stringify({
114114
sources: sources
115115
})));
116116

117+
let hasError = false;
118+
117119
if (!output) {
118120
abort('No output from compiler');
119121
} else if (output['errors']) {
@@ -123,6 +125,7 @@ if (!output) {
123125
console.log(message.formattedMessage)
124126
} else {
125127
console.error(message.formattedMessage)
128+
hasError = true
126129
}
127130
}
128131
}
@@ -157,3 +160,7 @@ for (var fileName in output.contracts) {
157160
originalUncaughtExceptionListeners.forEach(function (listener) {
158161
process.addListener('uncaughtException', listener);
159162
});
163+
164+
if (hasError) {
165+
process.exit(1);
166+
}

0 commit comments

Comments
 (0)