fix: stopped filesystem from breaking at build

This commit is contained in:
ThinLiquid 2024-01-23 14:33:24 +00:00 committed by GitHub
parent c08dec6743
commit 54a92c5d79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "flowos",
"version": "1.1.0",
"version": "2.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "flowos",
"version": "1.1.0",
"version": "2.0.0",
"license": "MIT",
"dependencies": {
"ansi-to-html": "^0.7.2",

View file

@ -1,4 +1,6 @@
import { Directory, Errors, File, Permission, Stats } from '../types'
import path from 'path'
const p = path
export const defaultFS: { root: Directory } = {
root: {
@ -218,7 +220,7 @@ class VirtualFS {
private async addMissingFiles (): Promise<void> {
const addDirectoryRecursive = async (directory: Directory, directoryPath: string): Promise<void> => {
for (const [key, value] of Object.entries(directory.children)) {
const path = (await import('path')).join(directoryPath, key)
const path = p.join(directoryPath, key)
if (value.type === 'directory') {
if (!await this.exists(path)) {
await this.mkdir(path)