Skip to content

Instantly share code, notes, and snippets.

@faustinoaq
Last active July 13, 2024 05:59
Show Gist options
  • Save faustinoaq/c8ea0491d0da057a19a9c8b921c3bde4 to your computer and use it in GitHub Desktop.
Save faustinoaq/c8ea0491d0da057a19a9c8b921c3bde4 to your computer and use it in GitHub Desktop.
Bash Source with python pip logic to add or remove packages from requirements.txt on install or remove
alias pi='pip install'
alias pu='pip uninstall -y'
# pip add
pa() {
pi $1 && pip freeze | grep -i $1 | tee -a requirements.txt
}
# pip remove
pr() {
pu $1 && sed -i "/$1/Id" requirements.txt
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment