From 657b698e1eba7fde2322bb81547eba26491c0af4 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 19 Dec 2018 14:11:08 +0100 Subject: Add sol-compiler watch mode --- packages/sol-compiler/src/utils/compiler.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'packages/sol-compiler/src/utils/compiler.ts') diff --git a/packages/sol-compiler/src/utils/compiler.ts b/packages/sol-compiler/src/utils/compiler.ts index 034f72f8d..486d8bedd 100644 --- a/packages/sol-compiler/src/utils/compiler.ts +++ b/packages/sol-compiler/src/utils/compiler.ts @@ -12,6 +12,7 @@ import { binPaths } from '../solc/bin_paths'; import { constants } from './constants'; import { fsWrapper } from './fs_wrapper'; +import { CompilationError } from './types'; /** * Gets contract data on network or returns if an artifact does not exist. @@ -147,13 +148,13 @@ function printCompilationErrorsAndWarnings(solcErrors: solc.SolcError[]): void { if (!_.isEmpty(errors)) { errors.forEach(error => { const normalizedErrMsg = getNormalizedErrMsg(error.formattedMessage || error.message); - logUtils.warn(chalk.red(normalizedErrMsg)); + logUtils.log(chalk.red('error'), normalizedErrMsg); }); - throw new Error('Compilation errors encountered'); + throw new CompilationError(errors.length); } else { warnings.forEach(warning => { const normalizedWarningMsg = getNormalizedErrMsg(warning.formattedMessage || warning.message); - logUtils.warn(chalk.yellow(normalizedWarningMsg)); + logUtils.log(chalk.yellow('warning'), normalizedWarningMsg); }); } } -- cgit v1.2.3