docs: fix bad example (#1913)
This commit is contained in:
@@ -93,13 +93,9 @@ Prevent opencode from reading `.env` files:
|
|||||||
```javascript title=".opencode/plugin/env-protection.js"
|
```javascript title=".opencode/plugin/env-protection.js"
|
||||||
export const EnvProtection = async ({ client, $ }) => {
|
export const EnvProtection = async ({ client, $ }) => {
|
||||||
return {
|
return {
|
||||||
tool: {
|
"tool.execute.before": async (input, output) => {
|
||||||
execute: {
|
if (input.tool === "read" && output.args.filePath.includes(".env")) {
|
||||||
before: async (input, output) => {
|
throw new Error("Do not read .env files")
|
||||||
if (input.tool === "read" && output.args.filePath.includes(".env")) {
|
|
||||||
throw new Error("Do not read .env files")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user