#!/usr/bin/env node var colors = require('colors') var fs = require('fs') var argv = require('minimist')(process.argv.slice(2)) var packageJson = require('../package.json') global.repoComponents = 'https://raw.githubusercontent.com/MobileUI/components/master/dist/' global.repoTemplates = 'https://raw.githubusercontent.com/MobileUI/templates/master/' // commands var command_install = require('./command/command_install') var command_preview = require('./command/command_preview') var getCommands = function () { for (i in argv._) { if (!argv[argv._[i]]) { argv[argv._[i]] = true } } return argv } global.commands = getCommands(); (function mockapp () { var showIntro = function () { console.log('') console.log(' __ __ _ _ _ _ _ ___ ') console.log(' | \\/ | ___ | |__ (_) | ___| | | |_ _|') console.log(" | |\\/| |/ _ \\| '_ \\| | |/ _ \\ | | || | ") console.log(' | | | | (_) | |_) | | | __/ |_| || | ') console.log(' |_| |_|\\___/|_.__/|_|_|\\___|\\___/|___|') console.log('') console.log('\n_______________________________________________\n'.green) console.log(' Version installed: ', packageJson.version) console.log('_______________________________________________\n'.green) } if (!commands._.length) { showIntro() } else { if (commands.install) { command_install.run() } else if (commands.preview) { command_preview.run() } else { console.log(' ERROR: '.bgRed, 'Command not exist!') } } })()