diff --git a/learn-generators.js b/learn-generators.js index 17c254c..29da4f3 100755 --- a/learn-generators.js +++ b/learn-generators.js @@ -1,8 +1,14 @@ -#!/usr/bin/env node +#!/usr/bin/env node --harmony -const workshopper = require('workshopper'), - path = require('path') - credits = require('./credits') +const workshopper = require('workshopper'), + path = require('path'), + credits = require('./credits'), + hasGenerators = require('has-generators') + +if(!hasGenerators) { + console.error('You need nodejs >= 0.11.x or iojs >= 1.0.x to work with generators.') + process.exit() +} function fpath (f) { return path.join(__dirname, f) diff --git a/package.json b/package.json index 7d9126d..2df8ac6 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ ], "dependencies": { "colors-tmpl": "~1.0.0", + "has-generators": "^1.0.1", "workshopper": "^2.1.1", "workshopper-exercise": "^2.1.0", "workshopper-wrappedexec": "^0.1.2"