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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.27.11";
4
+ const version = "0.27.12";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -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 functionDef = cliJson[selectedCmd][selectedScript];
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: functionDef
189
+ handler: selectedFunctionObj.handler
184
190
  }];
185
191
  } else {
186
192
  const scripts = cliJson[commandName];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.27.11",
4
+ "version": "0.27.12",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {