mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-10 19:43:19 +08:00
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
16 lines
673 B
Swift
16 lines
673 B
Swift
import Foundation
|
|
|
|
func makeTempDirForTests() throws -> URL {
|
|
let base = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)
|
|
let dir = base.appendingPathComponent(UUID().uuidString, isDirectory: true)
|
|
try FileManager().createDirectory(at: dir, withIntermediateDirectories: true)
|
|
return dir
|
|
}
|
|
|
|
func makeExecutableForTests(at path: URL) throws {
|
|
try FileManager().createDirectory(
|
|
at: path.deletingLastPathComponent(),
|
|
withIntermediateDirectories: true)
|
|
FileManager().createFile(atPath: path.path, contents: Data("echo ok\n".utf8))
|
|
try FileManager().setAttributes([.posixPermissions: 0o755], ofItemAtPath: path.path)
|
|
}
|