silgi 0.27.11 → 0.27.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/prepare.mjs +9 -3
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/cli/prepare.mjs
CHANGED
|
@@ -152,7 +152,7 @@ const command$1 = defineCommand({
|
|
|
152
152
|
const scripts = cliJson[cmd];
|
|
153
153
|
for (const scriptName of Object.keys(scripts)) {
|
|
154
154
|
const script = scripts[scriptName];
|
|
155
|
-
if (script.type === "function") {
|
|
155
|
+
if (script && script.type === "function") {
|
|
156
156
|
availableFunctions.push({
|
|
157
157
|
command: cmd,
|
|
158
158
|
script: scriptName,
|
|
@@ -176,11 +176,17 @@ const command$1 = defineCommand({
|
|
|
176
176
|
if (!selectedFunction)
|
|
177
177
|
return;
|
|
178
178
|
const [selectedCmd, selectedScript] = selectedFunction.split(":");
|
|
179
|
-
const
|
|
179
|
+
const selectedFunctionObj = availableFunctions.find(
|
|
180
|
+
(fn) => fn.command === selectedCmd && fn.script === selectedScript
|
|
181
|
+
);
|
|
182
|
+
if (!selectedFunctionObj || !selectedFunctionObj.handler) {
|
|
183
|
+
consola.error(`Function ${selectedCmd}:${selectedScript} not found or invalid`);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
180
186
|
selectedCommands = [{
|
|
181
187
|
command: selectedCmd,
|
|
182
188
|
script: selectedScript,
|
|
183
|
-
handler:
|
|
189
|
+
handler: selectedFunctionObj.handler
|
|
184
190
|
}];
|
|
185
191
|
} else {
|
|
186
192
|
const scripts = cliJson[commandName];
|