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" },