diff --git a/index.js b/index.js index a3dcf3c..0840d33 100755 --- a/index.js +++ b/index.js @@ -9,7 +9,7 @@ import { request } from 'https' import { red, cyan, blue } from 'kolorist' import prompts from 'prompts' import fs from 'iofs' -import { resolve, join, dirname } from 'path' +import { resolve, join, dirname, normalize } from 'path' import { writePackageJson, writeConfigFile, @@ -29,8 +29,8 @@ import { } from './lib/demo-js.js' const CURRENT_DIR = process.cwd() -const root = dirname( - import.meta.url.slice(process.platform === 'win32' ? 10 : 7) +const root = normalize( + dirname(import.meta.url.slice(process.platform === 'win32' ? 8 : 7)) ) const VERSION = '1.0.1' @@ -130,6 +130,8 @@ function printHelp() { res.projectName = DEFAULT_NAME } + targetDir = normalize(targetDir) + console.log('指定的项目名为: %s', cyan(res.projectName)) console.log('项目目录为: %s', cyan(targetDir)) diff --git a/lib/demo-config.js b/lib/demo-config.js index a5fa567..7009db7 100644 --- a/lib/demo-config.js +++ b/lib/demo-config.js @@ -63,7 +63,7 @@ export default { 'vue-router': '//jscdn.ink/@bytedo/vue-router/4.1.6/vue-router.js', // 'vue-router': '//jscdn.ink/vue-router/4.1.6/vue-router.esm-browser.js', // '@vue/devtools-api': '//jscdn.ink/@vue/devtools-api/6.5.0/esm/index.js', - fetch: '//jscdn.ink/@bytedo/fetch/2.1.1/next.js' + fetch: '//jscdn.ink/@bytedo/fetch/2.1.5/next.js' } } diff --git a/package.json b/package.json index 04ab983..b9c7dba 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "create-vue-live", "type": "module", - "version": "1.0.4", + "version": "1.0.5", "bin": { "create-vue-live": "index.js" },