From c1ae15437fb90389d9c06a37c591f20c46bb2bdb Mon Sep 17 00:00:00 2001 From: James Prevett Date: Sat, 12 Oct 2024 18:16:41 -0500 Subject: [PATCH] Updating the config saves to /etc/fstab --- src/config.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/config.ts b/src/config.ts index b27b913..d87f0b0 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/only-throw-error */ import type { Backend, OptionsOf } from '@zenfs/core'; -import { Fetch, InMemory, mounts, Overlay, Port } from '@zenfs/core'; +import fs, { Fetch, InMemory, mounts, Overlay, Port } from '@zenfs/core'; import { WebAccess, WebStorage, IndexedDB } from '@zenfs/dom'; import { Iso } from '@zenfs/iso'; import { Zip } from '@zenfs/zip'; @@ -252,8 +252,10 @@ $('#config .add').on('click', createNewMountConfig); $('#config .update').on('click', () => { const configs = parseConfig(); - console.log(configs); - console.log(toFSTable(configs)); + if (!fs.existsSync('/etc')) { + fs.mkdirSync('/etc'); + } + fs.writeFileSync('/etc/fstab', toFSTable(configs)); }); $('#config .download').on('click', () => {