feat: edit volume

This commit is contained in:
Nicolas Meienberger
2025-09-03 21:42:18 +02:00
parent ca4bd4a619
commit 91020e6f23
17 changed files with 790 additions and 319 deletions

View File

@@ -1,14 +1,17 @@
import * as fs from "node:fs/promises";
import type { BackendConfig } from "@ironmount/schemas";
import type { VolumeBackend } from "../backend";
const mount = async () => {
const mount = async (_config: BackendConfig, path: string) => {
console.log("Mounting directory volume...");
await fs.mkdir(path, { recursive: true });
};
const unmount = async () => {
console.log("Cannot unmount directory volume.");
};
export const makeDirectoryBackend = (): VolumeBackend => ({
mount,
export const makeDirectoryBackend = (config: BackendConfig, path: string): VolumeBackend => ({
mount: () => mount(config, path),
unmount,
});