Last active
March 22, 2019 14:25
-
-
Save noir-neo/3a2071dc6d8ea8300caed4bc2bb2de26 to your computer and use it in GitHub Desktop.
download zip and deploy to gh-pages
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/bash | |
| set -eu | |
| if [ $# -ne 2 ]; then | |
| exit 1 | |
| fi | |
| wget $1 -O tmp.zip | |
| unzip tmp.zip | |
| unzip -qql tmp.zip | head -n1 | tr -s ' ' | cut -d' ' -f5- | sed -e 's/\/.*//g' | sed -e 's/ /\\ /g' | xargs -I '{}' mv {} tmp | |
| pushd tmp | |
| git init | |
| git remote add origin $2 | |
| git checkout -b gh-pages | |
| git add -A | |
| git commit -m deploy | |
| git push -f origin gh-pages | |
| popd | |
| rm -rf tmp.zip tmp |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
./deploy-zip-to-gh-pages.sh "path/to/your.zip" git@github.com:your/repository.git