Permalink
Browse files

fix(importer): throw clear unsupported error for webpack projects

closes #735
  • Loading branch information...
JeroenVinke committed Sep 3, 2017
1 parent 238b863 commit 5b23897061e44fb06ba3c4d8453114447ee2107c
Showing with 16 additions and 4 deletions.
  1. +8 −2 lib/commands/import/command.js
  2. +8 −2 lib/commands/install/command.js
@@ -2,17 +2,23 @@
const ImportEngine = require('../../importer/import-engine');
const ArgumentParser = require('../install/package-argument-parser');
const Project = require('../../project').Project;
module.exports = class {
static inject() { return [ImportEngine, ArgumentParser]; }
static inject() { return [ImportEngine, ArgumentParser, Project]; }
constructor(engine, argumentParser) {
constructor(engine, argumentParser, project) {
this.engine = engine;
this.argumentParser = argumentParser;
this.project = project;
}
execute(args) {
if (this.project.model.bundler && this.project.model.bundler.id !== 'cli') {
throw new Error('This command is only available for the Aurelia CLI Bundler');
}
let packages = this.argumentParser.parse(args);
if (packages.length === 0) {
@@ -3,19 +3,25 @@
const ImportCommand = require('../import/command');
const PackageInstaller = require('../../importer/package-installer');
const ArgumentParser = require('./package-argument-parser');
const Project = require('../../project').Project;
const logger = require('aurelia-logging').getLogger('Install');
module.exports = class {
static inject() { return [PackageInstaller, ImportCommand, ArgumentParser]; }
static inject() { return [PackageInstaller, ImportCommand, ArgumentParser, Project]; }
constructor(packageInstaller, importCommand, argumentParser) {
constructor(packageInstaller, importCommand, argumentParser, project) {
this.packageInstaller = packageInstaller;
this.importCommand = importCommand;
this.argumentParser = argumentParser;
this.project = project;
}
execute(args) {
if (this.project.model.bundler && this.project.model.bundler.id !== 'cli') {
throw new Error('This command is only available for the Aurelia CLI Bundler');
}
let packages = new ArgumentParser().parse(args);
if (packages.length === 0) {

0 comments on commit 5b23897

Please sign in to comment.