Simplify Windows path calc for NuGet source
This commit is contained in:
parent
3490e2ff82
commit
229be2b0a0
|
@ -284,7 +284,12 @@ jobs:
|
|||
path: ${{ github.workspace }}/nuget
|
||||
- name: Add NuGet packages as a local NuGet source
|
||||
run: |
|
||||
dotnet nuget add source $(./scripts/normpath $PWD/nuget)
|
||||
echo "PULUMI_LOCAL_NUGET=$PULUMI_LOCAL_NUGET"
|
||||
SOURCE=$(./scripts/normpath $PULUMI_LOCAL_NUGET)
|
||||
echo "SOURCE=$SOURCE"
|
||||
dotnet nuget add source $SOURCE
|
||||
env:
|
||||
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
|
||||
- name: Verify Pulumi Version
|
||||
run: |
|
||||
which pulumi
|
||||
|
|
|
@ -5,7 +5,7 @@ GitHub actions workers.
|
|||
|
||||
For example, on Windows:
|
||||
|
||||
$ python realpath.py /d/a/pulumi/pulumi/nuget
|
||||
$ ./scripts/normpath "D:\\a\\pulumi\\pulumi/nuget"
|
||||
D:\a\pulumi\pulumi\nuget
|
||||
|
||||
"""
|
||||
|
@ -17,12 +17,6 @@ import sys
|
|||
path = sys.argv[1]
|
||||
|
||||
if os.name == 'nt':
|
||||
path = pathlib.PureWindowsPath(path)
|
||||
if path.root == '\\':
|
||||
# Assume drive is encoded as /d/x/full/path
|
||||
_, drive, rest = str(path).split('\\', 2)
|
||||
print(pathlib.PureWindowsPath(f'{drive}:\\', rest))
|
||||
else:
|
||||
print(path)
|
||||
print(pathlib.PureWindowsPath(path))
|
||||
else:
|
||||
print(pathlib.PurePosixPath(path))
|
||||
|
|
Loading…
Reference in a new issue