Skip to content

Commit

Permalink
chore(project): adding a script for upgrading vue version (element-pl…
Browse files Browse the repository at this point in the history
…us#660)

* chore(project): adding a script for upgrading vue version

* Update locale.spec.ts

Co-authored-by: zazzaz <[email protected]>
  • Loading branch information
jw-foss and zazzaz authored Nov 23, 2020
1 parent fcc5ea2 commit 41655b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"lint-fix": "eslint --fix ./packages --ext .vue,.js,.ts",
"website-build": "rimraf website-dist && cross-env NODE_ENV=production webpack --config ./website/webpack.config.js",
"website-dev": "webpack-dev-server --config ./website/webpack.config.js",
"website-dev:play": "cross-env PLAY_ENV=true yarn website-dev"
"website-dev:play": "cross-env PLAY_ENV=true yarn website-dev",
"upgrade:vue": "bash ./scripts/update-versions.sh"
},
"peerDependencies": {
"vue": "^3.0.0"
Expand Down
1 change: 0 additions & 1 deletion packages/locale/__test__/locale.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { mount } from '@vue/test-utils'
import { t, use } from '../index'
import zhCn from '../lang/zh-cn'
import en from '../lang/en'
Expand Down
12 changes: 12 additions & 0 deletions scripts/update-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /bin/bash

export FILE_PATH="$(cd $(dirname "${BASH_SOURCE[0]}")/../packages/ && pwd)"
SED_REX="s/\"vue\": \"\^[0-9]\.[0-9]\.[0-9].*\"/\"vue\": \"$1\"/"

for FILE_NAME in "$(find ${FILE_PATH} -type f -name 'package.json' | cut -d' ' -f1-)"
do
sed -i '' "${SED_REX}" $FILE_NAME
done

sed -i '' "${SED_REX}" "$(dirname ${BASH_SOURCE[0]})/gc.sh"
sed -i '' "${SED_REX}" "$(dirname ${BASH_SOURCE[0]})/../package.json"

0 comments on commit 41655b6

Please sign in to comment.