mirror of
https://github.com/marvinscham/masterthesis-playground.git
synced 2025-12-06 18:20:53 +01:00
Added hook to flush Jupyter notebook outputs
This commit is contained in:
13
hooks/pre-commit
Normal file
13
hooks/pre-commit
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
for f in $(git diff --name-only --cached); do
|
||||
if [[ $f == *.ipynb ]]; then
|
||||
jupyter nbconvert --clear-output --inplace $f
|
||||
git add $f
|
||||
fi
|
||||
done
|
||||
|
||||
if git diff --name-only --cached --exit-code
|
||||
then
|
||||
echo "No changes detected after removing notebook output"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user