help message for nbdiff_checkpoint

main
ziembla 2017-12-10 18:38:25 +01:00
parent 6e4004f16c
commit 5bb9d6d3df
1 changed files with 8 additions and 1 deletions

View File

@ -1,9 +1,16 @@
#!/bin/bash #!/bin/bash
if [ "$#" -ne 1 ]; then
echo "usage: nbdiff_checkpoint NOTEBOOK.ipynb"
echo
echo "Show differences between given jupyter notebook and its checkpointed version (in .ipynb_checkpoints subdirectory)"
exit
fi
DIRNAME=$(dirname "$1") DIRNAME=$(dirname "$1")
BASENAME=$(basename "$1" .ipynb) BASENAME=$(basename "$1" .ipynb)
WORKING_COPY=$DIRNAME/$BASENAME.ipynb WORKING_COPY=$DIRNAME/$BASENAME.ipynb
CHECKPOINT_COPY=$DIRNAME/.ipynb_checkpoints/$BASENAME-checkpoint.ipynb CHECKPOINT_COPY=$DIRNAME/.ipynb_checkpoints/$BASENAME-checkpoint.ipynb
echo "How change $CHECKPOINT_COPY into $WORKING_COPY" echo "----- Analysing how to change $CHECKPOINT_COPY into $WORKING_COPY -----"
nbdiff "$CHECKPOINT_COPY" "$WORKING_COPY" --ignore-details nbdiff "$CHECKPOINT_COPY" "$WORKING_COPY" --ignore-details