diff --git a/actions/add.action.ts b/actions/add.action.ts index 51c5f691b..f91e23f08 100644 --- a/actions/add.action.ts +++ b/actions/add.action.ts @@ -3,19 +3,19 @@ import { Input } from '../commands'; import { getValueOrDefault } from '../lib/compiler/helpers/get-value-or-default'; import { AbstractPackageManager, - PackageManagerFactory, + PackageManagerFactory } from '../lib/package-managers'; import { AbstractCollection, CollectionFactory, - SchematicOption, + SchematicOption } from '../lib/schematics'; import { MESSAGES } from '../lib/ui'; import { loadConfiguration } from '../lib/utils/load-configuration'; import { askForProjectName, moveDefaultProjectToStart, - shouldAskForProject, + shouldAskForProject } from '../lib/utils/project-utils'; import { AbstractAction } from './abstract.action'; @@ -44,6 +44,7 @@ export class AddAction extends AbstractAction { MESSAGES.LIBRARY_INSTALLATION_FAILED_BAD_PACKAGE(libraryName), ), ); + throw new Error(MESSAGES.LIBRARY_INSTALLATION_FAILED_BAD_PACKAGE(libraryName)); } } diff --git a/actions/build.action.ts b/actions/build.action.ts index 9658dcc23..7553afc0e 100644 --- a/actions/build.action.ts +++ b/actions/build.action.ts @@ -13,7 +13,7 @@ import { WebpackCompiler } from '../lib/compiler/webpack-compiler'; import { WorkspaceUtils } from '../lib/compiler/workspace-utils'; import { ConfigurationLoader, - NestConfigurationLoader, + NestConfigurationLoader } from '../lib/configuration'; import { defaultOutDir } from '../lib/configuration/defaults'; import { FileSystemReader } from '../lib/readers'; @@ -62,6 +62,7 @@ export class BuildAction extends AbstractAction { } else { console.error(`\n${chalk.red(err)}\n`); } + process.exit(1); } } diff --git a/commands/add.command.ts b/commands/add.command.ts index 9f1aaa350..ad7c6b7d9 100644 --- a/commands/add.command.ts +++ b/commands/add.command.ts @@ -30,7 +30,7 @@ export class AddCommand extends AbstractCommand { try { await this.action.handle(inputs, options, flags); } catch (err) { - process.exit(0); + process.exit(1); } }); }