Skip to content

Instantly share code, notes, and snippets.

@joedmck
Last active July 29, 2022 21:57
Show Gist options
  • Save joedmck/8417c1503a2d7d6cd0e37f087ad8db6c to your computer and use it in GitHub Desktop.
Save joedmck/8417c1503a2d7d6cd0e37f087ad8db6c to your computer and use it in GitHub Desktop.
Bash script to install all requirements.txt files in a monorepo with multiple Python microservices (with separate requirements.txt files for Docker build reasons).
#!/usr/bin/env bash
set -e
cd $(dirname $0)
handle_requirements_file() {
echo -e "\n\033[0;36m == Found requirements.txt at $1. Installing. == \033[0m\n"
pip3 install -r $1
}
export -f handle_requirements_file
find . -name "requirements.txt" -type f -exec bash -c 'handle_requirements_file "$0"' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment