tweak commandline access

This commit is contained in:
kjeld Schouten-Lebbing 2022-01-16 15:59:43 +01:00
parent 2564e4256a
commit 191adb9012
No known key found for this signature in database
GPG Key ID: 4CDAD4A532BC1EDB
4 changed files with 18 additions and 6 deletions

View File

@ -6,7 +6,7 @@ name: Test & Upload to TestPyPI
on: on:
# Triggers the workflow on push to the master branch # Triggers the workflow on push to the master branch
push: push:
branches: [ master ] branches: [ main ]
# Allows you to run this workflow manually from the Actions tab # Allows you to run this workflow manually from the Actions tab
workflow_dispatch: workflow_dispatch:

View File

@ -7,7 +7,7 @@ README_MD = open(join(dirname(abspath(__file__)), "README.md")).read()
setup( setup(
name="trueupdate", name="trueupdate",
version="1.0.0", version="1.0.1",
# The packages that constitute your project. # The packages that constitute your project.
# For my project, I have only one - "pydash". # For my project, I have only one - "pydash".
@ -18,6 +18,10 @@ setup(
# you can instead use the py_modules field instead. # you can instead use the py_modules field instead.
# EITHER py_modules OR packages should be present. # EITHER py_modules OR packages should be present.
packages=find_packages(), packages=find_packages(),
entry_points = {
'console_scripts': ['trueupdate=trueupdate.command_line:main'],
}
# The description that will be shown on PyPI. # The description that will be shown on PyPI.
# Keep it short and concise # Keep it short and concise

View File

@ -76,6 +76,12 @@ def fetch_charts():
charts = rawcharts.stdout.decode('utf-8') charts = rawcharts.stdout.decode('utf-8')
return(charts) return(charts)
def run()
get_args()
charts = fetch_charts()
parse_charts(charts)
execute_upgrades()
def get_args(): def get_args():
if len(sys.argv) == 3: if len(sys.argv) == 3:
SEMVER = sys.argv[2] or "minor" SEMVER = sys.argv[2] or "minor"
@ -83,8 +89,6 @@ def get_args():
CATALOG = sys.argv[1] or "ALL" CATALOG = sys.argv[1] or "ALL"
if __name__ == '__main__': if __name__ == '__main__':
get_args() run()
charts = fetch_charts()
parse_charts(charts)
execute_upgrades()
exit(0) exit(0)

View File

@ -0,0 +1,4 @@
import trueupdate
def main():
print trueupdate.run()