plugin-updater 1.4.2 → 1.4.3
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.js +7 -3
- package/dist/init.js +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -135,7 +135,7 @@ async function promptInitApps(_present, defaultApp) {
|
|
|
135
135
|
"Initialize plugins for which app?",
|
|
136
136
|
` [1] opencode${defaultApp === "opencode" ? " (default)" : ""}`,
|
|
137
137
|
` [2] claude${defaultApp === "claude" ? " (default)" : ""}`,
|
|
138
|
-
|
|
138
|
+
` [3] both${defaultApp === "both" ? " (default)" : ""}`,
|
|
139
139
|
].join("\n"));
|
|
140
140
|
for (;;) {
|
|
141
141
|
const ans = (await rl.question(`> ${defaultApp ? `[${defaultApp}] ` : "1/2/3 "}`)).trim().toLowerCase();
|
|
@@ -145,8 +145,12 @@ async function promptInitApps(_present, defaultApp) {
|
|
|
145
145
|
return ["claude"];
|
|
146
146
|
if (ans === "3" || ans === "both")
|
|
147
147
|
return ["opencode", "claude"];
|
|
148
|
-
if (ans === ""
|
|
149
|
-
|
|
148
|
+
if (ans === "") {
|
|
149
|
+
if (defaultApp === "both")
|
|
150
|
+
return ["opencode", "claude"];
|
|
151
|
+
if (defaultApp)
|
|
152
|
+
return [defaultApp];
|
|
153
|
+
}
|
|
150
154
|
// empty with no default, or unrecognized → re-ask
|
|
151
155
|
}
|
|
152
156
|
}
|
package/dist/init.js
CHANGED
|
@@ -59,8 +59,8 @@ export function cwdApp(cwd = process.cwd()) {
|
|
|
59
59
|
// Decide which app(s) `init` targets. Explicit --app always wins. A single detected
|
|
60
60
|
// app is used directly. When both or neither are detected we PROMPT (if interactive)
|
|
61
61
|
// so the user can pick one or both; non-interactively we keep the hard error rather
|
|
62
|
-
// than guess. The prompt default is the cwd-inferred app
|
|
63
|
-
//
|
|
62
|
+
// than guess. The prompt default is the cwd-inferred app when the cwd is a config dir,
|
|
63
|
+
// otherwise "both" (a neutral dir like /workspace defaults to setting up both apps).
|
|
64
64
|
export async function resolveInitApps(explicit, deps) {
|
|
65
65
|
if (explicit === "claude" || explicit === "opencode")
|
|
66
66
|
return [explicit];
|
|
@@ -72,5 +72,5 @@ export async function resolveInitApps(explicit, deps) {
|
|
|
72
72
|
if (!deps.isTTY) {
|
|
73
73
|
throw new Error("Both apps (or neither) found - pass --app claude or --app opencode");
|
|
74
74
|
}
|
|
75
|
-
return deps.prompt(p, deps.cwdApp());
|
|
75
|
+
return deps.prompt(p, deps.cwdApp() ?? "both");
|
|
76
76
|
}
|