@cg3/equip 0.9.1 → 0.9.2
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/bin/equip.js +9 -9
- package/package.json +1 -1
package/bin/equip.js
CHANGED
|
@@ -59,7 +59,8 @@ function cmdHelp() {
|
|
|
59
59
|
console.log("Usage: equip <command> [options]");
|
|
60
60
|
console.log("");
|
|
61
61
|
console.log("Commands:");
|
|
62
|
-
console.log(" <tool> Install
|
|
62
|
+
console.log(" <tool> Install a registered tool (e.g. equip prior)");
|
|
63
|
+
console.log(" <package> Install any npm package (e.g. equip my-docs)");
|
|
63
64
|
console.log(" ./script.js Run a local setup script (for development)");
|
|
64
65
|
console.log(" . Run current directory's package bin entry");
|
|
65
66
|
console.log(" uninstall <tool> Remove an installed tool (alias: unequip)");
|
|
@@ -156,15 +157,14 @@ function dispatchTool(alias, extraArgs) {
|
|
|
156
157
|
const entry = TOOLS[alias];
|
|
157
158
|
|
|
158
159
|
if (!entry) {
|
|
159
|
-
// No registry match — treat as a package name
|
|
160
|
+
// No registry match — treat as a package name
|
|
161
|
+
// equip my-docs setup → npx -y my-docs@latest setup
|
|
162
|
+
// equip my-docs → npx -y my-docs@latest setup (default command)
|
|
160
163
|
const pkg = alias;
|
|
161
|
-
const command = extraArgs.shift();
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
process.exit(1);
|
|
166
|
-
}
|
|
167
|
-
spawnTool(pkg, command, extraArgs, null);
|
|
164
|
+
const command = extraArgs.length > 0 ? extraArgs.shift() : "setup";
|
|
165
|
+
// Infer tool name from package (strip scope: @myorg/my-docs → my-docs)
|
|
166
|
+
const inferredName = pkg.includes("/") ? pkg.split("/").pop() : pkg;
|
|
167
|
+
spawnTool(pkg, command, extraArgs, inferredName);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
170
|
|