migrate: move flock and hash utilities to shared package (#22640)

This commit is contained in:
Dax
2026-04-15 11:50:24 -04:00
committed by GitHub
parent f1751401aa
commit 4ae7c77f8a
23 changed files with 929 additions and 41 deletions

View File

@@ -3,6 +3,7 @@ import { xdgData, xdgCache, xdgConfig, xdgState } from "xdg-basedir"
import path from "path"
import os from "os"
import { Filesystem } from "../util/filesystem"
import { Flock } from "@opencode-ai/shared/util/flock"
const app = "opencode"
@@ -26,6 +27,9 @@ export namespace Global {
}
}
// Initialize Flock with global state path
Flock.setGlobal({ state })
await Promise.all([
fs.mkdir(Global.Path.data, { recursive: true }),
fs.mkdir(Global.Path.config, { recursive: true }),