Compare commits

..

7 Commits

Author SHA1 Message Date
127f03c434 download tar.gz files 2022-08-04 16:27:16 +03:00
086085d031 need to add '/' after nexus_host 2022-08-04 10:46:52 +03:00
0f0366341d need to add '/' end of nexus_host 2022-08-03 22:28:33 +03:00
d6d97ebc33 hide some files 2022-08-03 22:26:41 +03:00
6bd277aee7 download with depens 2022-08-03 16:46:54 +03:00
260c96402e remove urls.txt 2022-06-01 16:11:08 +03:00
3fcdffd727 update the search function 2022-06-01 16:10:33 +03:00
2 changed files with 34 additions and 5 deletions

0
README.md Normal file → Executable file
View File

View File

@@ -14,7 +14,7 @@ print_help() {
search_package() { search_package() {
local package=$1 local package=$1
curl https://pypi.org/project/$package/\#files -s | grep -Eo https://files\.+$package\.+whl > urls.txt curl https://pypi.org/project/$package/\#files -s | grep -Eo https://files\.+\.+tar.gz > urls.txt
} }
download_package() { download_package() {
@@ -43,14 +43,43 @@ upload_packages() {
remove_all_packages() { remove_all_packages() {
rm *.whl *.tar.gz urls.txt rm *.whl *.tar.gz
}
init_venv() {
python3.9 -m venv venv
source venv/bin/activate
pip install freeze
}
install_requriments() {
pip install -r $1
}
create_new_requriments() {
pip freeze > .requirments.txt
grep -Eo '^\w[^==]+' .requirments.txt > .new_requirments.txt
rm .requirments.txt
}
remove_venv() {
rm -r venv/
} }
main() { main() {
if [[ $# -eq 1 ]]; then if [[ $# -eq 1 ]]; then
search_package $@ init_venv
download_package install_requriments $@
create_new_requriments
remove_venv
cat .new_requirments.txt | while read line; do
search_package $line
download_package
done
rm .new_requirments.txt urls.txt
elif [[ $# -eq 2 ]]; then elif [[ $# -eq 2 ]]; then
upload_packages $@ upload_packages $@
remove_all_packages remove_all_packages