From a1ae04dad6cb7893aa5c7701f33798651802a675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Fri, 25 Nov 2016 18:37:52 +0100 Subject: [PATCH] Delete nuxt-init, use nuxt/starter instead --- bin/nuxt-init | 81 --------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100755 bin/nuxt-init diff --git a/bin/nuxt-init b/bin/nuxt-init deleted file mode 100755 index 78e6362e94..0000000000 --- a/bin/nuxt-init +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env node - -const co = require('co') -const fs = require('fs-extra') -const pify = require('pify') -const { resolve, join, basename } = require('path') -const { existsSync, writeFile } = require('fs') -const mkdirp = pify(fs.mkdirp) - -const rootDir = resolve(process.argv.slice(2)[0] || '.') - -if (basename(rootDir) === 'pages') { - console.warn('Your root directory is named "pages". This looks suspicious. You probably want to go one directory up.') - process.exit(0) -} - -co(function * () { - yield new Promise((resolve) => setTimeout(resolve, 0)) // avoid undefined variables basePackage, etc. - if (!existsSync(rootDir)) { - yield mkdirp(rootDir) - } - if (!existsSync(join(rootDir, 'package.json'))) { - yield pify(writeFile)(join(rootDir, 'package.json'), basePackage.replace(/my-app/g, basename(rootDir))) - } - if (!existsSync(join(rootDir, 'nuxt.config.js'))) { - yield pify(writeFile)(join(rootDir, 'nuxt.config.js'), baseConfig) - } - if (!existsSync(join(rootDir, 'static'))) { - yield mkdirp(join(rootDir, 'static')) - } - if (!existsSync(join(rootDir, 'pages'))) { - yield mkdirp(join(rootDir, 'pages')) - yield pify(writeFile)(join(rootDir, 'pages', 'index.vue'), basePage) - } -}) -.then(() => { - console.log('Nuxt project [' + basename(rootDir) + '] created') -}) -.catch((err) => { - console.error(err) - process.exit(1) -}) - -const basePackage = `{ - "name": "my-app", - "description": "", - "dependencies": { - "nuxt": "latest" - }, - "scripts": { - "start": "nuxt" - } -} -` - -const baseConfig = `module.exports = { - // Nuxt.js configuration file - // Please look at https://nuxtjs.org/guide/configuration -} -` - -const basePage = ` - - - - -`