Created
April 3, 2017 05:04
-
-
Save seanblanton/14a8de7d8e2415176d826fb6ec1efd4e to your computer and use it in GitHub Desktop.
Extract a specific folder in a post-receive hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git --work-tree=/var/www/html/ --git-dir=/var/repo/site.git checkout -f master -- dist/ | |
cd /var/www/html/ | |
cp -rRp dist/. . | |
rm -rf dist | |
// -rRp recursive copy files from /dist to current folder. Then delete the empty folder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment