From d6d97ebc335df4e266175a0561b821b8c7e3a9e9 Mon Sep 17 00:00:00 2001 From: Idan Cohen Date: Wed, 3 Aug 2022 22:26:41 +0300 Subject: [PATCH] hide some files --- pip-install.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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