=sbt Fix StreamOperatorsIndexGenerator on Windows (#31347)
This commit is contained in:
parent
bfafb8cf0f
commit
dc480ac9da
2 changed files with 12 additions and 5 deletions
|
|
@ -248,9 +248,15 @@ object StreamOperatorsIndexGenerator extends AutoPlugin {
|
|||
s"There must be at least 5 lines in $file, including the title, description, category link and an empty line between each two of them")
|
||||
// This forces the short description to be on a single line. We could make this smarter,
|
||||
// but 'forcing' the short description to be really short seems nice as well.
|
||||
val description = lines(2)
|
||||
.replaceAll("ref:?\\[(.*?)\\]\\(", "ref[$1](" + file.getAbsolutePath.replaceFirst(".*/([^/]+/).*", "$1"))
|
||||
require(!description.isEmpty, s"description in $file must be non-empty, single-line description at the 3rd line")
|
||||
val separator = java.io.File.separatorChar
|
||||
val path =
|
||||
if (separator != '/')
|
||||
file.getAbsolutePath.replace(separator, '/')
|
||||
else
|
||||
file.getAbsolutePath
|
||||
val description =
|
||||
lines(2).replaceAll("ref:?\\[(.*?)\\]\\(", "ref[$1](" + path.replaceFirst(".*/([^/]+/).*", "$1"))
|
||||
require(description.nonEmpty, s"description in $file must be non-empty, single-line description at the 3rd line")
|
||||
val categoryLink = lines(4)
|
||||
require(
|
||||
categoryLink.startsWith("@ref"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue