mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-30 14:14:20 +01:00
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"
|
||||
export const EnvProtection = async ({ client, $ }) => {
|
||||
return {
|
||||
tool: {
|
||||
execute: {
|
||||
before: async (input, output) => {
|
||||
if (input.tool === "read" && output.args.filePath.includes(".env")) {
|
||||
throw new Error("Do not read .env files")
|
||||
}
|
||||
}
|
||||
"tool.execute.before": async (input, output) => {
|
||||
if (input.tool === "read" && output.args.filePath.includes(".env")) {
|
||||
throw new Error("Do not read .env files")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user