#!/usr/bin/env node
// adapted based on rackt/history (MIT)
var execSync = require('child_process').execSync;
var stat = require('fs').stat;

function exec(command) {
  execSync(command, {
    stdio: [0, 1, 2]
  });
}

stat('dist-modules', function(error, stat) {
  if (error || !stat.isDirectory()) {
    exec('npm run dist-modules');
  }
});

#!/usr/bin/env node
// adapted based on rackt/history (MIT)
var execSync = require('child_process').execSync;
var stat = require('fs').stat;

function exec(command) {
  execSync(command, {
    stdio: [0, 1, 2]
  });
}

stat('dist-modules', function(error, stat) {
  if (error || !stat.isDirectory()) {
    exec('npm i babel');
    exec('npm run dist-modules');
  }
});

Install Babel before generating `dist-modules`
Install Babel before generating `dist-modules`

Otherwise it will rely on globally installed Babel. Not good.
