Last active
February 3, 2021 23:44
-
-
Save Fitzy1293/cd36943e8e2f5d1d4c9c9168212c5d44 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
green='\e[0;32m' | |
cyan='\e[0;36m' | |
white='\e[0m' | |
blue='\e[1;34m' | |
echo "${cyan}Enter a package from pypi:${green}" | |
read package | |
pypiUrl="https://pypi.org/project/${package}/" | |
versionOnPypi="$(curl ${pypiUrl} -s | grep "<a class=\"card release__card\" href=\"/project/${package}/" -m 1 | cut -d'/' -f4)" | |
echo "${cyan}${pypiUrl} version:\n${blue}${versionOnPypi}" | |
echo "${cyan}Enter a new version for building with poetry:${green}" | |
read poetryVersion | |
echo "\n${cyan}Backing up pyproject.toml${cyan}" && cp -v pyproject.toml backup_config.toml | |
echo "\nUpdating pyproject.toml" | |
sed -i "s/^version.*=.*$/version = \"${poetryVersion}\"/" pyproject.toml | |
echo | |
poetry build | |
poetry publish |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment