dev/add-package-publisher #16

Merged
joshb merged 6 commits from dev/add-package-publisher into main 2022-11-11 01:29:24 +00:00
Showing only changes of commit 6966d7572c - Show all commits

View File

@ -23,17 +23,21 @@ def main():
s.auth = (AUTH_USER, AUTH_PASS) s.auth = (AUTH_USER, AUTH_PASS)
# Delete Package # Delete Package
try: try:
s.delete( print("Deleting...")
result = s.delete(
f"{HOST}/api/packages/{OWNER}/generic/{PKG_NAME}/{PKG_VERSION}" f"{HOST}/api/packages/{OWNER}/generic/{PKG_NAME}/{PKG_VERSION}"
) )
result.raise_for_status()
except Exception: except Exception:
# Intentionally Overlook Issues Here # Intentionally Overlook Issues Here
pass print("No package to delete.")
# Add New Package # Add New Package
s.put( print("Adding new package...")
result = s.put(
( (
f"{HOST}/api/packages/{OWNER}/generic/{PKG_NAME}/{PKG_VERSION}/" + f"{HOST}/api/packages/{OWNER}/generic/{PKG_NAME}/{PKG_VERSION}/" +
FILE_NAME FILE_NAME
), ),
data=open(f"dist/{FILE_NAME}", 'rb').read(), data=open(f"dist/{FILE_NAME}", 'rb').read(),
) )
result.raise_for_status()