Skip to content

Commit 1c1d03a

Browse files
committed
Add forward slash to beginning of aliases in mv-guide.py
1 parent 7ee5801 commit 1c1d03a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mv-guide.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def parse_aliases(alias_line):
3333
aliases_as_clean_strings = map(
3434
lambda x: x.strip(" '[]"), aliases_as_messy_strings)
3535

36-
return set(map(lambda x: os.path.normpath(x).lower() + "/", aliases_as_clean_strings))
36+
return set(map(lambda x: ("" if os.path.isabs(x) else "/") + os.path.normpath(x).lower() + "/", aliases_as_clean_strings))
3737

3838

3939
def alias_style_path_for_path(content_dir, path):
4040
directory = os.path.dirname(path) if os.path.isfile(path) else path
4141
directory_abs_path = os.path.abspath(directory)
42-
return os.path.relpath(directory_abs_path, content_dir).lower() + "/"
42+
return "/" + os.path.relpath(directory_abs_path, content_dir).lower() + "/"
4343

4444

4545
def insert_alias(content_dir, markdown_file):

0 commit comments

Comments
 (0)