Skip to content

Commit 12fb058

Browse files
authored
Possible fix for issue on osx (#1338)
I believe OSX was unhappy with the empty string in the list, while ubuntu and windows were okay with it. Also added logic to make sure if the command fails the plugin doesn't try to split null. closes #1336
1 parent 90c6c28 commit 12fb058

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

Src/CSharpier.Rider/.prettierrc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
printWidth: 100
22
tabWidth: 4
33
plugins:
4-
- prettier-plugin-java
4+
- prettier-plugin-java

Src/CSharpier.Rider/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
# csharpier-rider Changelog
44

5+
## [1.8.1]
6+
- Possible fix for issue with OSX not being able to run dotnet tool list command
7+
58
## [1.8.0]
69
- Use dotnet tool list to find both local and global installs of csharpier.
710

Src/CSharpier.Rider/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
pluginGroup = com.intellij.csharpier
55
pluginName = csharpier
6-
pluginVersion = 1.8.0
6+
pluginVersion = 1.8.1
77

88
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
99
# for insight into build numbers and IntelliJ Platform versions.

Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierProcessProvider.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,21 @@ private String findCSharpierVersionInToolOutput(
141141
String directoryThatContainsFile,
142142
boolean isGlobal
143143
) {
144-
var command = List.of("tool", "list", (isGlobal ? "-g" : ""));
144+
var command = isGlobal ? List.of("tool", "list", "-g") : List.of("tool", "list");
145145
var output = DotNetProvider.getInstance(this.project).execDotNet(
146146
command,
147147
new File(directoryThatContainsFile)
148148
);
149149

150150
this.logger.debug(
151151
"Running 'dotnet tool list" + (isGlobal ? "-g" : "") + "' to look for version"
152-
);
152+
);
153153
this.logger.debug("Output was: \n " + output);
154154

155+
if (output == null) {
156+
return null;
157+
}
158+
155159
var lines = Arrays.stream(output.split("\n"))
156160
.map(String::trim)
157161
.filter(line -> !line.isEmpty())

0 commit comments

Comments
 (0)