Skip to content

Commit 6c8b11d

Browse files
committed
VFS Python Script v1.1
1 parent f93b5a6 commit 6c8b11d

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

  • examples/C/virtual_file_system

examples/C/virtual_file_system/vfs.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# WebUI Library
2+
# https://webui.me
3+
# https://github.com/webui-dev/webui
4+
# Copyright (c) 2020-2025 Hassan Draga.
5+
# Licensed under MIT License.
6+
# All rights reserved.
7+
# Canada.
8+
#
9+
# WebUI Virtual File System Generator
10+
# v1.1
11+
112
import os
213
import sys
314

@@ -53,7 +64,10 @@ def generate_vfs_header(directory, output_header):
5364

5465
header.write('static const char* index_files[] = {\n')
5566
for dir_path, index_path in index_files.items():
56-
header.write(f' "{dir_path}/", "{index_path}",\n')
67+
if dir_path == "/":
68+
header.write(f' "/", "{index_path}",\n')
69+
else:
70+
header.write(f' "{dir_path}/", "{index_path}",\n')
5771
header.write(' NULL\n')
5872
header.write('};\n\n')
5973

0 commit comments

Comments
 (0)