#!/usr/bin/env node var join = require('path').join var defaultCommand = 'dev' var commands = [] try { commands = require('fs').readdirSync(__dirname) } catch (e) { commands = [] } commands.push(defaultCommand, 'init') commands = new Set(commands) var cmd = process.argv[2] if (commands.has('nuxt-' + cmd)) { process.argv.splice(2, 1) } else { cmd = defaultCommand } var bin = join(__dirname, 'nuxt-' + cmd) require(bin)