direnv
This commit is contained in:
16
modules/_opencode/plugin/direnv.ts
Normal file
16
modules/_opencode/plugin/direnv.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import type { Plugin } from "@opencode-ai/plugin";
|
||||||
|
|
||||||
|
export const DirenvPlugin: Plugin = async ({ $ }) => {
|
||||||
|
return {
|
||||||
|
"shell.env": async (input, output) => {
|
||||||
|
try {
|
||||||
|
const exported = await $`direnv export json`
|
||||||
|
.cwd(input.cwd)
|
||||||
|
.quiet()
|
||||||
|
.json();
|
||||||
|
|
||||||
|
Object.assign(output.env, exported);
|
||||||
|
} catch {}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user