From 165decf0020a57e0c463c8974664a9a2c5d2725b Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Wed, 16 Jun 2021 10:39:01 -0500 Subject: [PATCH] more pubsync fixing --- tools/efrotools/efrocache.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/efrotools/efrocache.py b/tools/efrotools/efrocache.py index 2536918b..831976f5 100644 --- a/tools/efrotools/efrocache.py +++ b/tools/efrotools/efrocache.py @@ -47,11 +47,15 @@ def get_file_hash(path: str) -> str: def _project_centric_path(path: str) -> str: """Convert something like foo/../bar to simply bar.""" - projpath = f'{os.getcwd()}/' - abspath = os.path.abspath(path) + + # NOTE: we want this to function under raw Windows Python so lets + # keep everything using forward slashes which is what our cache maps + # use. + projpath = f'{os.getcwd()}/'.replace('\\', '/') + abspath = os.path.abspath(path).replace('\\', '/') if not abspath.startswith(projpath): raise RuntimeError( - f'Path "{path}" is not under project root "{projpath}"') + f'Path "{abspath}" is not under project root "{projpath}"') return abspath[len(projpath):]