refactor(app/web): new features (#1124) [skip ci]
This commit is contained in:
@@ -3,7 +3,7 @@ export default async function({login, q, imports, data, rest, graphql, queries,
|
||||
//Plugin execution
|
||||
try {
|
||||
//Check if plugin is enabled and requirements are met
|
||||
if ((!enabled) || (!q.contributors))
|
||||
if ((!enabled) || (!q.contributors) || (!imports.metadata.plugins.contributors.extras("enabled", {extras})))
|
||||
return null
|
||||
|
||||
//Load inputs
|
||||
@@ -70,7 +70,7 @@ export default async function({login, q, imports, data, rest, graphql, queries,
|
||||
|
||||
//Contributions categories
|
||||
const types = Object.fromEntries([...new Set(Object.keys(categories))].map(type => [type, new Set()]))
|
||||
if ((sections.includes("categories")) && (extras)) {
|
||||
if ((sections.includes("categories")) && (imports.metadata.plugins.contributors.extras("categories", {extras}))) {
|
||||
//Temporary directory
|
||||
const repository = `${repo.owner}/${repo.repo}`
|
||||
const path = imports.paths.join(imports.os.tmpdir(), `${repository.replace(/[^\w]/g, "_")}`)
|
||||
@@ -123,6 +123,6 @@ export default async function({login, q, imports, data, rest, graphql, queries,
|
||||
}
|
||||
//Handle errors
|
||||
catch (error) {
|
||||
throw {error: {message: "An error occured", instance: error}}
|
||||
throw imports.format.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user