Add Kinglet + a few fixes
[vchess.git] / hooks / post-update.dist
... / ...
CommitLineData
1## V1:
2#!/bin/sh
3# NOTE: the ssh part is not required if git repo and vchess are on the same server
4ssh user@server -t 'cd /path/to/vchess/client && git pull && npm run build'
5
6## V2:
7#!/bin/sh
8cd /path/to/vchess || exit
9# See https://stackoverflow.com/questions/4043609/getting-fatal-not-a-git-repository-when-using-post-update-hook-to-execut
10unset GIT_DIR
11git pull
12clientLines=`git diff-tree --no-commit-id --name-only -r HEAD | grep client | wc -l`
13if [ $clientLines -ne 0 ]; then
14 cd client
15 npm run build
16fi
17
18# NOTE: should also restart the service if server code changes