File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/util Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ package com.dropbox.affectedmoduledetector.util
2+
3+ import java.io.File
4+
5+ /* *
6+ * Returns an OS specific path respecting the separator character for the operating system.
7+ *
8+ * The Git client appears to only talk Unix-like paths however the Gradle client understands all
9+ * OS path variations. This causes issues on systems other than those that use the "/" path
10+ * character i.e. Windows. Therefore we need to normalise the path.
11+ */
12+ fun String.toOsSpecificPath (): String {
13+ return this .split(" /" ).joinToString(File .separator)
14+ }
15+
16+ /* *
17+ * Returns a String with an OS specific line endings for the operating system.
18+ *
19+ * The Git client appears to only talk Unix-like line endings ("\n") however the Gradle client
20+ * understands all OS line ending variants. This causes issues on systems other than those that
21+ * use Unix-like line endings i.e. Windows. Therefore we need to normalise the line endings.
22+ */
23+ fun String.toOsSpecificLineEnding (): String {
24+ return this .replace(" \n " , System .lineSeparator())
25+ }
You can’t perform that action at this time.
0 commit comments