mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat: edit volume
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user