Skip to content

Commit efafb0c

Browse files
Add Windows support to autocomplete.sh (#1373)
Co-authored-by: Martin Henz <henz@comp.nus.edu.sg>
1 parent c922ee6 commit efafb0c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/autocomplete.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ CONST_DECL = "const"
1010
FUNC_DECL = "func"
1111

1212

13-
base_dir = "docs/source"
13+
base_dir = f"docs{os.path.sep}source"
1414
src_filename = "global.html"
15-
out_dir = "src/editors/ace/docTooltip"
15+
out_dir = f"src{os.path.sep}editors{os.path.sep}ace{os.path.sep}docTooltip"
1616

1717

1818
def new_title_node(title):
@@ -76,7 +76,7 @@ def process_function(namespace, element):
7676

7777
def process_dir_globals(target):
7878
infile = os.path.join(base_dir, target, src_filename)
79-
with open(infile) as f:
79+
with open(infile, encoding="utf-8") as f:
8080
contents = "\n".join(f.readlines())
8181
try:
8282
tree = etree.HTML(contents)
@@ -96,7 +96,7 @@ def process_dir_globals(target):
9696

9797
Path(out_dir).mkdir(parents=True, exist_ok=True)
9898
outfile = os.path.join(out_dir, target + ".json")
99-
with open(outfile, "w") as f:
99+
with open(outfile, "w", encoding="utf-8") as f:
100100
json.dump(names, f, indent=2)
101101

102102
# Folder names for jsdoc html

0 commit comments

Comments
 (0)