refactor: replace Bun.write/file with Filesystem utilities in snapshot
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { $ } from "bun"
|
import { $ } from "bun"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import fs from "fs/promises"
|
import fs from "fs/promises"
|
||||||
|
import { Filesystem } from "../util/filesystem"
|
||||||
import { Log } from "../util/log"
|
import { Log } from "../util/log"
|
||||||
import { Flag } from "../flag/flag"
|
import { Flag } from "../flag/flag"
|
||||||
import { Global } from "../global"
|
import { Global } from "../global"
|
||||||
@@ -271,13 +272,12 @@ export namespace Snapshot {
|
|||||||
const target = path.join(git, "info", "exclude")
|
const target = path.join(git, "info", "exclude")
|
||||||
await fs.mkdir(path.join(git, "info"), { recursive: true })
|
await fs.mkdir(path.join(git, "info"), { recursive: true })
|
||||||
if (!file) {
|
if (!file) {
|
||||||
await Bun.write(target, "")
|
await Filesystem.write(target, "")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const text = await Bun.file(file)
|
const text = await Filesystem.readText(file).catch(() => "")
|
||||||
.text()
|
|
||||||
.catch(() => "")
|
await Filesystem.write(target, text)
|
||||||
await Bun.write(target, text)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function excludes() {
|
async function excludes() {
|
||||||
|
|||||||
Reference in New Issue
Block a user