Skip to content

Commit d20ef70

Browse files
committed
feat: skip postinstall script in the local env
1 parent f7ffae7 commit d20ef70

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.local

Whitespace-only changes.

scripts/postinstall.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
const fs = require('node:fs')
12
const { switchVersion, loadModule } = require('./utils')
23

34
const Vue = loadModule('vue')
45

5-
if (!Vue || typeof Vue.version !== 'string')
6+
if (fs.existsSync('.local'))
7+
console.log('Currently, it is the local development environment, not doing anything.')
8+
9+
else if (!Vue || typeof Vue.version !== 'string')
610
console.warn('[v-code-diff] Vue is not found. Please run "npm install vue" to install.')
711

812
else if (Vue.version.startsWith('2.7.'))
@@ -14,5 +18,4 @@ else if (Vue.version.startsWith('2.'))
1418
else if (Vue.version.startsWith('3.'))
1519
switchVersion('3')
1620

17-
else
18-
console.warn(`[v-code-diff] Vue version v${Vue.version} is not suppported.`)
21+
else console.warn(`[v-code-diff] Vue version v${Vue.version} is not suppported.`)

0 commit comments

Comments
 (0)