mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-01 20:33:46 +08:00
more pubsync fixing
This commit is contained in:
parent
30cbaeccef
commit
165decf002
@ -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):]
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user