Last active
August 29, 2015 14:06
-
-
Save iwat/dcfef45d91f9200e03ab to your computer and use it in GitHub Desktop.
Commit formatted extracted docx into GIT.
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 | |
if [ "$1" != "" ] && [ "$2" != "" ]; then | |
FILE=$1 | |
REPO=$1_repo | |
else | |
echo "$0 <docx file> <comment>" | |
exit 1 | |
fi | |
if [ ! -d "$REPO" ]; then | |
mkdir "$REPO" | |
cd "$REPO" | |
git init . | |
fi | |
cd "$REPO" | |
rm -rf * | |
unzip "../$FILE" | |
find . -type f -name "*.xml" -exec xmllint {} -format -output {} \; | |
find . -type f -name "*.rels" -exec xmllint {} -format -output {} \; | |
git add --all . | |
git commit -a -m "$2" | |
git status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment