mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Use the separator.
This commit is contained in:
parent
263c5d4e57
commit
e5d0d9193a
1 changed files with 3 additions and 2 deletions
|
@ -14,12 +14,13 @@ open public class UnversionedDep(open val groupId: String, open val artifactId:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turn this dependency to a directory. If fileSystem is true, use the file system
|
* Turn this dependency to a directory. If fileSystem is true, use the file system
|
||||||
* dependent path separator, otherwise, use '/' (used to create URL's)
|
* dependent path separator, otherwise, use '/' (used to create URL's). The returned
|
||||||
|
* string always ends with the path separator.
|
||||||
*/
|
*/
|
||||||
public fun toDirectory(v: String, fileSystem: Boolean = true): String {
|
public fun toDirectory(v: String, fileSystem: Boolean = true): String {
|
||||||
val sep = if (fileSystem) File.separator else "/"
|
val sep = if (fileSystem) File.separator else "/"
|
||||||
val l = listOf(groupId.replace(".", sep), artifactId, v)
|
val l = listOf(groupId.replace(".", sep), artifactId, v)
|
||||||
val result = Strings.Companion.join(sep, l)
|
val result = Strings.Companion.join(sep, l)
|
||||||
return if (result.endsWith("/")) result else result + "/"
|
return if (result.endsWith(sep)) result else result + sep
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue