评论操作 固定链接

Can you provide more information about what you're trying to do? Are you trying to get the GitHub name from the user in your plugin? Are you you trying to get user information from the GitHub API?

0
评论操作 固定链接

Yes, I want to read the user's GitHub information in the plug-in. I use this method now, but I want to know whether there is a simpler API to use

public static String readGithubName() {
String cmd="git config user.name";
String line;
StringBuilder sb = new StringBuilder();
Runtime runtime = Runtime.getRuntime();
try {
Process process = runtime.exec(cmd);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
while ((line = bufferedReader.readLine()) != null) {
sb.append(line);
}
return sb.toString();
} catch (Exception e) {
return "null";
}
}
0
评论操作 固定链接

Just now, I found it

org.jetbrains.plugins.github.authentication.accounts.GHAccountManager
0

请先登录再写评论。