Skip to content

Commit

Permalink
Tweak the logic around validating installs so it doesn't bomb out and… (
Browse files Browse the repository at this point in the history
#1339)

… provides a better log.

#1337
  • Loading branch information
belav authored Aug 28, 2024
1 parent 12fb058 commit 4d51407
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Src/CSharpier.Rider/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

# csharpier-rider Changelog

## [1.8.1]
## [1.8.2]
- Possible fix for issue with OSX not being able to run dotnet tool list command
- Better handling of error when validating custom install of csharpier

## [1.8.0]
- Use dotnet tool list to find both local and global installs of csharpier.
Expand Down
2 changes: 1 addition & 1 deletion Src/CSharpier.Rider/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pluginGroup = com.intellij.csharpier
pluginName = csharpier
pluginVersion = 1.8.1
pluginVersion = 1.8.2

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private String findCSharpierVersionInToolOutput(

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

if (output == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@ private boolean validateInstall(String pathToDirectoryForVersion, String version
command,
env,
new File(pathToDirectoryForVersion)
).trim();
);

if (output == null) {
return false;
}

this.logger.debug(this.getPathForVersion(version) + "--version output: " + version);
var versionWithoutHash = output.split(Pattern.quote("+"))[0];
var versionWithoutHash = output.trim().split(Pattern.quote("+"))[0];
this.logger.debug("Using " + versionWithoutHash + " as the version number.");

if (versionWithoutHash.equals(version)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static String executeCommand(
if (exitVal == 0) {
return result.toString().trim();
}
logger.debug(errorResult.toString());
logger.debug("ErrorOutput: " + errorResult);
} catch (Exception e) {
logger.error(e);
}
Expand Down

0 comments on commit 4d51407

Please sign in to comment.