@every-env/compound-plugin 0.5.1 → 0.5.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/package.json +1 -1
- package/src/commands/install.ts +8 -4
package/package.json
CHANGED
package/src/commands/install.ts
CHANGED
|
@@ -88,7 +88,8 @@ export default defineCommand({
|
|
|
88
88
|
if (!bundle) {
|
|
89
89
|
throw new Error(`Target ${targetName} did not return a bundle.`)
|
|
90
90
|
}
|
|
91
|
-
const
|
|
91
|
+
const hasExplicitOutput = Boolean(args.output && String(args.output).trim())
|
|
92
|
+
const primaryOutputRoot = resolveTargetOutputRoot(targetName, outputRoot, codexHome, hasExplicitOutput)
|
|
92
93
|
await target.write(primaryOutputRoot, bundle)
|
|
93
94
|
console.log(`Installed ${plugin.manifest.name} to ${primaryOutputRoot}`)
|
|
94
95
|
|
|
@@ -109,7 +110,7 @@ export default defineCommand({
|
|
|
109
110
|
console.warn(`Skipping ${extra}: no output returned.`)
|
|
110
111
|
continue
|
|
111
112
|
}
|
|
112
|
-
const extraRoot = resolveTargetOutputRoot(extra, path.join(outputRoot, extra), codexHome)
|
|
113
|
+
const extraRoot = resolveTargetOutputRoot(extra, path.join(outputRoot, extra), codexHome, hasExplicitOutput)
|
|
113
114
|
await handler.write(extraRoot, extraBundle)
|
|
114
115
|
console.log(`Installed ${plugin.manifest.name} to ${extraRoot}`)
|
|
115
116
|
}
|
|
@@ -181,10 +182,13 @@ function resolveOutputRoot(value: unknown): string {
|
|
|
181
182
|
return path.join(os.homedir(), ".config", "opencode")
|
|
182
183
|
}
|
|
183
184
|
|
|
184
|
-
function resolveTargetOutputRoot(targetName: string, outputRoot: string, codexHome: string): string {
|
|
185
|
+
function resolveTargetOutputRoot(targetName: string, outputRoot: string, codexHome: string, hasExplicitOutput: boolean): string {
|
|
185
186
|
if (targetName === "codex") return codexHome
|
|
186
187
|
if (targetName === "droid") return path.join(os.homedir(), ".factory")
|
|
187
|
-
if (targetName === "cursor")
|
|
188
|
+
if (targetName === "cursor") {
|
|
189
|
+
const base = hasExplicitOutput ? outputRoot : process.cwd()
|
|
190
|
+
return path.join(base, ".cursor")
|
|
191
|
+
}
|
|
188
192
|
return outputRoot
|
|
189
193
|
}
|
|
190
194
|
|