Skip to content

Commit

Permalink
correctly recognize Mac installations of IDEA 13 and earler as valid …
Browse files Browse the repository at this point in the history
…SDK homes
  • Loading branch information
yole committed Dec 23, 2014
1 parent 7235bf3 commit 40efd80
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugins/devkit/src/projectRoots/IdeaJdk.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,14 @@ else if (new File(sdkHome, "license/CLion_Preview_License.txt").exists()) {
@Nullable
public static String getBuildNumber(String ideaHome) {
try {
@NonNls final String buildTxt = SystemInfo.isMac ? "/Resources/build.txt" : "/build.txt";
return FileUtil.loadFile(new File(ideaHome + buildTxt)).trim();
@NonNls final String buildTxt = SystemInfo.isMac ? "Resources/build.txt" : "build.txt";
File file = new File(ideaHome, buildTxt);
if (SystemInfo.isMac && !file.exists()) {
// IntelliJ IDEA 13 and earlier used a different location for build.txt on Mac;
// recognize the old location as well
file = new File(ideaHome, "build.txt");
}
return FileUtil.loadFile(file).trim();
}
catch (IOException e) {
return null;
Expand Down

0 comments on commit 40efd80

Please sign in to comment.