Skip to content

Commit 9cc2c31

Browse files
committed
Chore: improve deploy script
1 parent ca49377 commit 9cc2c31

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"deploy": "node scripts/deploy",
4949
"lint": "eslint .",
5050
"preversion": "run-s lint build -s",
51-
"postversion": "git push && git push --tags && npm run deploy",
51+
"postversion": "git push && git push --tags && npm run deploy -- --skip-build",
5252
"update-deps": "npm install eslint@latest eslint-plugin-vue@next vue-eslint-parser@experimental",
5353
"watch": "cross-env NODE_ENV=development run-p watch:* -s",
5454
"watch:html": "cpx src/index.html dist --watch",

scripts/deploy.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const sh = require("shelljs")
44
const version = require("../package.json").version
5+
const skipBuild = (process.argv.indexOf("--skip-build") >= 0)
56

67
main()
78

@@ -10,8 +11,10 @@ main()
1011
* @returns {void}
1112
*/
1213
function main() {
13-
exec(`git checkout v${version}`)
14-
exec("npm run build")
14+
if (skipBuild) {
15+
exec(`git checkout v${version}`)
16+
exec("npm run build")
17+
}
1518
exec("git checkout gh-pages")
1619

1720
if (String(sh.cat("dist/versions.json")) !== String(sh.cat("versions.json"))) {

0 commit comments

Comments
 (0)