Skip to content

Commit

Permalink
Update index file default for single file
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed May 16, 2024
1 parent b8cf823 commit 02ba0c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ class PublishOp {
* @param value
*/
protected Object normalizePaths(value) {
if( value instanceof Path )
return List.of(normalizePath(value))
if( value instanceof Path ) {
final target = normalizePath(value)
return List.of(targetDir.relativize(target), target)

This comment has been minimized.

Copy link
@pditommaso

pditommaso May 16, 2024

Member

Think it should

return List.of(target.getName(), target)

I'd even consider removing the file extension

}

if( value instanceof Collection ) {
return value.collect { el ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class OutputDslTest extends Specification {
target.resolve('foo/file1.txt').text == 'Hello'
target.resolve('barbar/file2.txt').text == 'world'
target.resolve('barbar/index.csv').text == """\
"${target}/barbar/file2.txt"
"file2.txt","${target}/barbar/file2.txt"
""".stripIndent()
and:
1 * session.notifyFilePublish(target.resolve('foo/file1.txt'), file1)
Expand Down

0 comments on commit 02ba0c7

Please sign in to comment.