Skip to content

Commit

Permalink
Fix prepare-commit.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
tongyx361 committed Jun 21, 2024
1 parent ae4aa6e commit b091fa6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions utils/prepare-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ echo "${todo_nbs}" | xargs -I {} sh -c 'echo "Cleaning {}"; nbdev_clean --fname
echo "Running nbdev_prepare..."
nbdev_prepare

if [ -d "pipeline" ]; then
echo "Updating scripts from modified pipeline notebooks ..."
for f in $(echo ${todo_nbs} | grep -E '^pipeline/.*?\.ipynb$'); do
jupyter nbconvert --to python --no-prompt --TagRemovePreprocessor.enabled=True --TagRemovePreprocessor.remove_cell_tags dev "${f}"
pipeline_dir="utils"
if [ -d "${pipeline_dir}" ]; then
for f in ${todo_nbs}; do
if [[ "${f}" == "${pipeline_dir}/"*".ipynb" ]]; then
jupyter nbconvert --to python --no-prompt --TagRemovePreprocessor.enabled=True --TagRemovePreprocessor.remove_cell_tags dev "${f}"
fi
done
black pipeline/
black "${pipeline_dir}"

fi

git status

0 comments on commit b091fa6

Please sign in to comment.