Skip to content

Commit

Permalink
Fix link destination, fixes #89
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet authored and plamentotev committed Feb 26, 2023
1 parent 3edad29 commit 2d4c703
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private PlexusIoSymlinkResource( @Nonnull File symlinkfile, String name, @Nonnul
public String getSymlinkDestination()
throws IOException
{
return targetResource.getName();
return symLinkDestination;
}

public PlexusIoResource getTarget()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributes;

import org.codehaus.plexus.components.io.attributes.SymlinkUtils;
import org.codehaus.plexus.components.io.functions.SymlinkDestinationSupplier;
import org.codehaus.plexus.util.Os;
import org.junit.Test;

Expand All @@ -31,6 +32,8 @@ public void testRealSymlink()
assertTrue( r.isDirectory() );
final File target = SymlinkUtils.readSymbolicLink( file );
assertTrue( target.getName().endsWith( "targetDir" ) );
assertTrue( r instanceof SymlinkDestinationSupplier );
assertEquals( "targetDir/", ( ( SymlinkDestinationSupplier ) r ).getSymlinkDestination() );
}

@Test
Expand Down

0 comments on commit 2d4c703

Please sign in to comment.