兼容脑残的windows

master
yutent 2023-02-21 17:44:45 +08:00
parent f01e52a415
commit d477caf939
3 changed files with 7 additions and 5 deletions

View File

@ -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))

View File

@ -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'
}
}

View File

@ -1,7 +1,7 @@
{
"name": "create-vue-live",
"type": "module",
"version": "1.0.4",
"version": "1.0.5",
"bin": {
"create-vue-live": "index.js"
},