File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
plugin-gradle/src/main/java/com/diffplug/gradle/spotless Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 26
26
import org .gradle .api .Project ;
27
27
import org .gradle .api .artifacts .repositories .MavenArtifactRepository ;
28
28
29
+ import com .diffplug .spotless .FileSignature ;
29
30
import com .diffplug .spotless .FormatterStep ;
30
31
import com .diffplug .spotless .rome .RomeStep ;
31
32
@@ -207,7 +208,11 @@ private File findDataDir() {
207
208
var localRepo = currentRepo != null ? (MavenArtifactRepository ) currentRepo : project .getRepositories ().mavenLocal ();
208
209
try {
209
210
// e.g. ~/.m2/repository/
210
- var repoPath = Paths .get (localRepo .getUrl ().getPath ());
211
+ var path = localRepo .getUrl ().getPath ();
212
+ if (FileSignature .machineIsWin () && path .startsWith ("/" )) {
213
+ path = path .substring (1 );
214
+ }
215
+ var repoPath = Paths .get (path );
211
216
var dataPath = repoPath .resolve ("com" ).resolve ("diffplug" ).resolve ("spotless" ).resolve ("spotless-data" );
212
217
return dataPath .toAbsolutePath ().toFile ();
213
218
} finally {
You can’t perform that action at this time.
0 commit comments