Skip to content

Commit 28a4517

Browse files
committed
add snapshot field in config to disable snapshots
1 parent b00b2de commit 28a4517

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/opencode/src/config/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ export namespace Config {
233233
theme: z.string().optional().describe("Theme name to use for the interface"),
234234
keybinds: Keybinds.optional().describe("Custom keybind configurations"),
235235
plugin: z.string().array().optional(),
236+
snapshot: z.boolean().optional(),
236237
share: z
237238
.enum(["manual", "auto", "disabled"])
238239
.optional()

packages/opencode/src/snapshot/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import fs from "fs/promises"
55
import { Log } from "../util/log"
66
import { Global } from "../global"
77
import { z } from "zod"
8+
import { Config } from "../config/config"
89

910
export namespace Snapshot {
1011
const log = Log.create({ service: "snapshot" })
@@ -26,6 +27,8 @@ export namespace Snapshot {
2627
export async function track() {
2728
const app = App.info()
2829
if (!app.git) return
30+
const cfg = await Config.get()
31+
if (cfg.snapshot === false) return
2932
const git = gitdir()
3033
if (await fs.mkdir(git, { recursive: true })) {
3134
await $`git init`

0 commit comments

Comments
 (0)