1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-25 07:57:12 -07:00

Normalize.

This commit is contained in:
Cedric Beust 2017-03-26 10:18:45 -07:00
parent 2a7775529d
commit 981bbbacb6

View file

@ -115,8 +115,8 @@ class KFiles {
*/
fun joinFileAndMakeDir(vararg ts: String) = joinDir(joinAndMakeDir(ts.slice(0..ts.size - 2)), ts[ts.size - 1])
fun fixSlashes(f: File) = KFiles.fixSlashes(f.path)
fun fixSlashes(s: String) = s.replace('\\', '/')
fun fixSlashes(f: File) = f.normalize().path.replace('\\', '/')
fun fixSlashes(s: String) = fixSlashes(File(s))
fun makeDir(dir: String, s: String? = null) =
(if (s != null) File(dir, s) else File(dir)).apply { mkdirs() }