From 475bfa47a5ec1d714dee039a092f65b2b1204113 Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 18 Oct 2022 18:25:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 5 +++-- package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 93e7b49..cd9ef36 100755 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ */ import fs from 'iofs' -import { resolve, join } from 'path' +import { resolve, join, dirname } from 'path' import { writePackageJson, writeConfigFile, writeGitIgnore } from './lib/demo-config.js' import { writeHtmlFile } from './lib/demo-html.js' import { writeLogo } from './lib/logo.js' @@ -20,7 +20,8 @@ import { writeStore } from './lib/demo-js.js' -const { version } = JSON.parse(fs.cat('./package.json')) +const root = dirname(import.meta.url.slice(7)) +const { version } = JSON.parse(fs.cat(join(root, './package.json'))) let args = process.argv.slice(2) diff --git a/package.json b/package.json index baaa80d..eb5fb7c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@bytedo/vue-live-cli", "type": "module", - "version": "0.0.6", + "version": "0.0.7", "bin": { "vue-live-cli": "index.js" },