Skip to content

Commit

Permalink
wait, do we even need this?
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Beck committed Jun 18, 2020
1 parent 8337c6b commit eee4180
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions core/dbt/clients/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,29 +182,30 @@ def convert_path(path: str) -> str:
On other platforms, this is a no-op.
"""
if sys.platform != 'win32':
return path
prefix = '\\\\?\\'
# Nothing to do
if path.startswith(prefix):
return path
path = os.path.normpath(path)
if path.startswith('\\'):
# if a path starts with '\\', splitdrive() on it will return '' for the
# drive, but the prefix requires a drive letter. So let's add the drive
# letter back in.
curdrive = os.path.splitdrive(os.getcwd())[0]
path = curdrive + path

# now our path is either an absolute UNC path or relative to the current
# directory. If it's relative, we need to make it absolute or the prefix
# won't work.
if not os.path.splitdrive(path)[0]:
path = os.path.join(os.getcwd(), path)

if not path.startswith(prefix):
path = prefix + path
return path
# if sys.platform != 'win32':
# return path
# prefix = '\\\\?\\'
# # Nothing to do
# if path.startswith(prefix):
# return path
# path = os.path.normpath(path)
# if path.startswith('\\'):
# # if a path starts with '\\', splitdrive() on it will return '' for the
# # drive, but the prefix requires a drive letter. So let's add the drive
# # letter back in.
# curdrive = os.path.splitdrive(os.getcwd())[0]
# path = curdrive + path

# # now our path is either an absolute UNC path or relative to the current
# # directory. If it's relative, we need to make it absolute or the prefix
# # won't work.
# if not os.path.splitdrive(path)[0]:
# path = os.path.join(os.getcwd(), path)

# if not path.startswith(prefix):
# path = prefix + path
# return path


def remove_file(path: str) -> None:
Expand Down

0 comments on commit eee4180

Please sign in to comment.