Skip to content

Conversation

@andyleejordan
Copy link
Member

This action is completely valid on both Windows and Linux (and OS X)
operating systems; tested with mklink and ln -s respectively.

Note that targets for hard links must exist, thus we check specifically
for symbolic links.

Both the path globber in session state and the New-Item implementation
needed to be fixed to allow the target not to exist.

Resolves #801.


This change is Reviewable

This action is completely valid on both Windows and Linux (and OS X)
operating systems; tested with `mklink` and `ln -s` respectively.

Note that targets for hard links must exist, thus we check specifically
for symbolic links.

Both the path globber in session state and the `New-Item` implementation
needed to be fixed to allow the target not to exist.

Resolves #801.

Also enable symbolic link tests on Windows.
@andyleejordan andyleejordan force-pushed the andschwa/symbolic-target branch from 2377094 to 3a43126 Compare April 10, 2016 01:45
@andyleejordan
Copy link
Member Author

FYI @LeeHolmes

@andyleejordan
Copy link
Member Author

Merging because I need this to make packages.

@andyleejordan andyleejordan merged commit 244b41a into master Apr 10, 2016
@andyleejordan andyleejordan deleted the andschwa/symbolic-target branch April 10, 2016 01:55
@vors
Copy link
Collaborator

vors commented Apr 11, 2016

Review status: 0 of 3 files reviewed at latest revision, 3 unresolved discussions.


test/powershell/New-Item.Tests.ps1, line 119 [r1] (raw file):
Please add a symlink test for a directory.

  1. Create non-existing
  2. Test ls on it
  3. Create matching dir
  4. Test ls again

test/powershell/New-Item.Tests.ps1, line 122 [r1] (raw file):
not sure that this is the right behavior


test/powershell/New-Item.Tests.ps1, line 128 [r1] (raw file):
How does somebody can figure out that this symlink is broken?


Comments from Reviewable

@andyleejordan
Copy link
Member Author

Review status: 0 of 3 files reviewed at latest revision, 3 unresolved discussions.


test/powershell/New-Item.Tests.ps1, line 119 [r1] (raw file):
Yeah that would be good to have. I'll add it to the backlog.


test/powershell/New-Item.Tests.ps1, line 122 [r1] (raw file):
This is the right behavior; the link file exists. If it didn't, this PR would be wrong.


test/powershell/New-Item.Tests.ps1, line 128 [r1] (raw file):
By testing the existence of its Target, as done here.


Comments from Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix creation of symbolic links to non-existing files

3 participants