fix: Try resolving

This commit is contained in:
Henry Schreiner
2020-07-06 14:25:02 -04:00
parent 8466194576
commit 317397b39a
+9 -2
View File
@@ -18,11 +18,18 @@ IS_RUNNING_ON_AZURE = Path('C:\\hostedtoolcache').exists()
IS_RUNNING_ON_TRAVIS = os.environ.get('TRAVIS_OS_NAME') == 'windows'
def normalize(x: [Union[str, PathLike]], cwd: Optional[PathLike]) -> str:
if hasattr(x, 'resolve'):
return str((cwd / x if cwd is not None else x).resolve())
else:
return x
def shell(args: Sequence[Union[str, PathLike]], env: Optional[Dict[str, str]] = None,
cwd: Optional[str] = None) -> int:
command = ' '.join(str(a) for a in args)
command = ' '.join(normalize(a, cwd) for a in args)
print(f'+ {command}')
return subprocess.check_call(list(str(a) for a in args), env=env, cwd=cwd)
return subprocess.check_call(list(normalize(a, cwd) for a in args), env=env, cwd=cwd)
def get_nuget_args(version: str, arch: str) -> List[str]: