diff --git a/pip-install.sh b/pip-install.sh index 3abbf59..1d97ac2 100755 --- a/pip-install.sh +++ b/pip-install.sh @@ -14,7 +14,7 @@ print_help() { search_package() { local package=$1 - curl https://pypi.org/project/$package/\#files -s | grep -Eo https://files\.+\.+whl | grep -Ev 'macos|arch|arm' > urls.txt + curl https://pypi.org/project/$package/\#files -s | grep -Eo https://files\.+\.+whl | grep -Ev 'macos|arch|arm|cp27' > urls.txt } download_package() { @@ -43,7 +43,7 @@ upload_packages() { remove_all_packages() { - rm *.whl *.tar.gz urls.txt + rm *.whl *.tar.gz } @@ -58,9 +58,9 @@ install_requriments() { } create_new_requriments() { - pip freeze > requirments.txt - grep -Eo '^\w[^==]+' requirments.txt > new_requirments.txt - rm requirments.txt + pip freeze > .requirments.txt + grep -Eo '^\w[^==]+' .requirments.txt > .new_requirments.txt + rm .requirments.txt } @@ -75,10 +75,11 @@ main() { install_requriments $@ create_new_requriments remove_venv - cat new_requirments.txt | while read line; do + cat .new_requirments.txt | while read line; do search_package $line download_package done + rm .new_requirments.txt urls.txt elif [[ $# -eq 2 ]]; then upload_packages $@ remove_all_packages