Skip to content

Commit

Permalink
build: install dependency for vue-server-renderer in setup script (vu…
Browse files Browse the repository at this point in the history
  • Loading branch information
jkzing authored and hefeng committed Jan 25, 2019
1 parent 30538a9 commit b0f74bb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
8 changes: 0 additions & 8 deletions build/install-hooks.js

This file was deleted.

26 changes: 26 additions & 0 deletions build/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const { test, ln, chmod, cd, exec } = require('shelljs')
const path = require('path')

const baseUrl = path.resolve()

function installHooks () {
if (test('-e', '.git/hooks')) {
ln('-sf', '../../build/git-hooks/pre-commit', '.git/hooks/pre-commit')
chmod('+x', '.git/hooks/pre-commit')
ln('-sf', '../../build/git-hooks/commit-msg', '.git/hooks/commit-msg')
chmod('+x', '.git/hooks/commit-msg')
}
}

function setupSSR () {
const ssrBase = path.resolve('packages/vue-server-renderer')
if (!test('-e', path.join(ssrBase, 'node_modules'))) {
cd(ssrBase)
exec('npm install')
cd(baseUrl)
}
}

installHooks()
setupSSR()

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"release": "bash build/release.sh",
"release:weex": "bash build/release-weex.sh",
"release:note": "node build/gen-release-note.js",
"setup": "node build/install-hooks.js",
"setup": "node build/setup.js",
"commit": "git-cz"
},
"repository": {
Expand Down

0 comments on commit b0f74bb

Please sign in to comment.