Skip to content

Commit

Permalink
fix: 修复 publish 脚本执行时机错误的问题 (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
oasis-cloud authored Dec 12, 2022
1 parent f82ced4 commit 564539b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/taro/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ const path = require('path')
const fsExtra = require('fs-extra')
const packageData = require('../../package.json')

if (packageData.name.indexOf('-taro')) {
if (packageData.name.indexOf('-taro') > -1) {
console.log('postpublish done')
fsExtra.copySync(
path.join(process.cwd(), 'node_modules/.cache/package.json.bk'),
path.join(process.cwd(), 'package.json'),
Expand Down
3 changes: 2 additions & 1 deletion scripts/taro/prepublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ const path = require('path')
const packageData = require('../../package.json')
const fsExtra = require('fs-extra')

if (packageData.name.indexOf('-taro')) {
if (packageData.name.indexOf('-taro') > -1) {
console.log('prepublish done')
fsExtra.copySync(
path.join(process.cwd(), 'package.json'),
path.join(process.cwd(), 'node_modules/.cache/package.json.bk'),
Expand Down

0 comments on commit 564539b

Please sign in to comment.