generated from Seekra/repository-template
feat(build): implement artifact processor
This commit is contained in:
@@ -14,12 +14,15 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { processArtifact } from './artifact.js';
|
||||
|
||||
const runPlugin = async function runPlugin (plugin) {
|
||||
const result = plugin();
|
||||
if (result instanceof Promise) return await result;
|
||||
else return result;
|
||||
};
|
||||
|
||||
export const processPlugin = async function processPlugin (plugin) {
|
||||
await runPlugin(plugin);
|
||||
export const processPlugin = async function processPlugin (plugin, options) {
|
||||
const { artifacts } = await runPlugin(plugin);
|
||||
for (const artifact of artifacts) await processArtifact(artifact, options);
|
||||
};
|
||||
Reference in New Issue
Block a user