diff --git a/npm_install.py b/npm_install.py index 3e8ef79..89bd1b2 100644 --- a/npm_install.py +++ b/npm_install.py @@ -26,6 +26,24 @@ def download_all_package(): packages_urls = get_all_urls_packages() for package_url in packages_urls: download_npm_package(package_url, "npm-packages") + +def upload_package(nexus_host, repository, package_file): + if nexus_host[-1] != "/": + nexus_host += "/" + res = requests.post( + nexus_host + "service/rest/v1/components?repository=" + repository, + headers={ + "accept": "application/json", + "Content-Type": "multipart/form-data" + }, + files={ + "npm.asset": open(package_file, "rb") + }) + return res + + +def publish_all_packages(): + pass def main():