-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
27 lines (21 loc) · 928 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import verifyPackage from "./lib/verify.js";
import preparePackage from "./lib/prepare.js";
let verified;
export async function verifyConditions(pluginConfig, context) {
const { options } = context;
if (options.prepare) {
const preparePlugin = castArray(options.prepare).find(config => config.path && config.path === "@iam1337/create-unitypackage") || {};
pluginConfig.packageRoot = defaultTo(pluginConfig.packageRoot, preparePlugin.packageRoot);
pluginConfig.projectRoot = defaultTo(pluginConfig.projectRoot, preparePlugin.projectRoot);
pluginConfig.output = defaultTo(pluginConfig.output, preparePlugin.output);
}
verifyPackage(pluginConfig, context);
verified = true;
}
export async function prepare(pluginConfig, context) {
if (!verified) {
verifyPackage(pluginConfig, context);
verified = true;
}
preparePackage(pluginConfig, context);
}