| 1124 | } |
| 1125 | |
| 1126 | export async function update(config: Info) { |
| 1127 | const jsoncPath = path.join(Instance.directory, "arctic.jsonc") |
| 1128 | const jsonPath = path.join(Instance.directory, "arctic.json") |
| 1129 | const filepath = (await Bun.file(jsoncPath).exists()) ? jsoncPath : jsonPath |
| 1130 | const existing = await loadFile(filepath) |
| 1131 | await Bun.write(filepath, JSON.stringify(mergeDeep(existing, config), null, 2)) |
| 1132 | await Instance.dispose() |
| 1133 | } |
| 1134 | |
| 1135 | export async function directories() { |
| 1136 | return state().then((x) => x.directories) |