Last active
July 13, 2024 05:59
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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