Created
June 8, 2023 09:37
-
-
Save JeanElsner/15c5304e8f965f1326b5ce97c6e7949c to your computer and use it in GitHub Desktop.
Single-line shell command to add extra-index-url to pip if it's not added already
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
extra_url=`pip config get global.extra-index-url 2>/dev/null`; url="<new-extra-url>"; if [[ ! $extra_url =~ $url ]]; then pip config set global.extra-index-url "$extra_url $url"; fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment