dev/add-package-publisher #16
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user