Skip to content

Commit

Permalink
Update: Handle unsupported versions better
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 21, 2017
1 parent dfc5713 commit 312e1db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
15 changes: 6 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var path = require('path');
var gutil = require('gulp-util');
var chalk = require('chalk');
var nomnom = require('nomnom');
var semver = require('semver');
var Liftoff = require('liftoff');
var tildify = require('tildify');
var interpret = require('interpret');
Expand Down Expand Up @@ -117,14 +116,6 @@ function handleArguments(env) {
exit(1);
}

// Check for semver difference between cli and local installation
// TODO: remove when we support all
if (semver.gt(cliVersion, env.modulePackage.version)) {
gutil.log(chalk.red('Warning: gulp version mismatch:'));
gutil.log(chalk.red('Global gulp is', cliVersion));
gutil.log(chalk.red('Local gulp is', env.modulePackage.version));
}

// Chdir before requiring gulpfile to make sure
// we let them chdir as needed
if (process.cwd() !== env.cwd) {
Expand All @@ -138,6 +129,12 @@ function handleArguments(env) {
// Find the correct CLI version to run
var range = findRange(env.modulePackage.version, ranges);

if (!range) {
return gutil.log(
chalk.red('Unsupported gulp version', env.modulePackage.version)
);
}

// Load and execute the CLI version
require(path.join(__dirname, '/lib/versioned/', range, '/'))(opts, env);
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"matchdep": "^0.3.0",
"nomnom": "^1.8.0",
"pretty-hrtime": "^1.0.0",
"semver": "^5.0.0",
"semver-greatest-satisfied-range": "^1.0.0",
"tildify": "^1.0.0",
"v8flags": "^2.0.9",
Expand Down

0 comments on commit 312e1db

Please sign in to comment.