Skip to content

Instantly share code, notes, and snippets.

@SubhadityaMukherjee
Created August 24, 2021 20:39
Show Gist options
  • Select an option

  • Save SubhadityaMukherjee/6325d1f044811e773dfdd4f01f3a840f to your computer and use it in GitHub Desktop.

Select an option

Save SubhadityaMukherjee/6325d1f044811e773dfdd4f01f3a840f to your computer and use it in GitHub Desktop.
bash code
# format for python and sort the imports
black "." && isort .
# generate readme
pipreqs .
# Newline
echo "
" >> README.md
# Find all subdirectories but keep the depth to 2 | Add a - to keep the markdown syntax 
fd . - type d - maxdepth 2 | sed "s/^/- /" >> README.md
# create scripts if there are any notebook files
for i in $(fd - glob "*.ipynb"); do jupytext - to py $i; done
if [ ! -z $1 ]; then
 git add . && git commit -m $1 && git push
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment