powerpoint2git/hooks/pre-commit

26 lines
519 B
Text
Raw Normal View History

2023-02-24 15:27:12 +00:00
#!/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
#