fixing node exports

This commit is contained in:
NEOLPAR 2022-09-09 12:15:38 +01:00
parent 347e7d33e8
commit 0e7c302a1b
1 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@ const {
const { join } = require("path") const { join } = require("path")
const fetch = require("node-fetch") const fetch = require("node-fetch")
export const uploadedFilePlugin = async file => { exports.uploadedFilePlugin = async file => {
if (!file.name.endsWith(".tar.gz")) { if (!file.name.endsWith(".tar.gz")) {
throw new Error("Plugin must be compressed into a gzipped tarball.") throw new Error("Plugin must be compressed into a gzipped tarball.")
} }
@ -19,7 +19,7 @@ export const uploadedFilePlugin = async file => {
return await getPluginMetadata(path) return await getPluginMetadata(path)
} }
export const uploadedNpmPlugin = async (url, name, headers = {}) => { exports.uploadedNpmPlugin = async (url, name, headers = {}) => {
let npmTarballUrl = url let npmTarballUrl = url
let pluginName = name let pluginName = name
@ -66,7 +66,7 @@ export const uploadedNpmPlugin = async (url, name, headers = {}) => {
return await getPluginMetadata(path) return await getPluginMetadata(path)
} }
export const uploadedUrlPlugin = async (url, name = "", headers = {}) => { exports.uploadedUrlPlugin = async (url, name = "", headers = {}) => {
if (!url.includes(".tar.gz")) { if (!url.includes(".tar.gz")) {
throw new Error("Plugin must be compressed into a gzipped tarball.") throw new Error("Plugin must be compressed into a gzipped tarball.")
} }
@ -76,7 +76,7 @@ export const uploadedUrlPlugin = async (url, name = "", headers = {}) => {
return await getPluginMetadata(path) return await getPluginMetadata(path)
} }
export const uploadedGithubPlugin = async (ctx, url, name = "", token = "") => { exports.uploadedGithubPlugin = async (ctx, url, name = "", token = "") => {
let githubUrl = url let githubUrl = url
if (!githubUrl.includes("https://github.com/")) { if (!githubUrl.includes("https://github.com/")) {
@ -140,7 +140,7 @@ export const uploadedGithubPlugin = async (ctx, url, name = "", token = "") => {
} }
} }
export const downloadUnzipTarball = async (url, name, headers = {}) => { const downloadUnzipTarball = async (url, name, headers = {}) => {
try { try {
const path = createTempFolder(name) const path = createTempFolder(name)