powerpoint2git/hooks/pre-commit

26 lines
519 B
Bash

#!/bin/sh
files=$(git diff --cached --name-only --diff-filter=ACM)
rm .changes
touch .changes
for f in $files
do
echo "File: $f"
if [[ ( $f == *.ppt ) || ( $f == *.pptx ) ]]
then
echo "Unzipping Powerpoint: $f"
new_dir=".$(basename $f)"
new_path="$(dirname $f)/$new_dir"
echo "new_dir= $new_dir"
echo "new_path= $new_path"
rm -r $new_path
unzip $f -d $new_path
echo $f >> .changes
mv .git/hooks/post-commit.disabled .git/hooks/post-commit # enable hook
echo "Post-commit enabled"
fi
done
#