Skip to content

Commit 3f57680

Browse files
committedNov 29, 2024··
fix: set default python execute to python 3 and update && closed #146
1 parent c172e50 commit 3f57680

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎core/src/main/kotlin/com/phodal/shirecore/provider/shire/FileRunService.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ interface FileRunService {
150150

151151
fun runInCli(project: Project, psiFile: PsiFile, args: List<String>? = null): String? {
152152
val commandLine = when (psiFile.language.displayName.lowercase()) {
153-
"python" -> GeneralCommandLine("python", psiFile.virtualFile.path)
153+
"python" -> GeneralCommandLine("python3", psiFile.virtualFile.path)
154154
"javascript" -> GeneralCommandLine("node", psiFile.virtualFile.path)
155155
"ecmascript 6" -> GeneralCommandLine("node", psiFile.virtualFile.path)
156156
"ruby" -> GeneralCommandLine("ruby", psiFile.virtualFile.path)
@@ -173,14 +173,15 @@ interface FileRunService {
173173
output.stdout
174174
} catch (e: Exception) {
175175
e.printStackTrace()
176-
null
176+
e.message
177177
}
178178
}
179179

180180
fun runInCli(project: Project, virtualFile: VirtualFile, args: List<String>? = null): String? {
181181
val psiFile = runReadAction {
182182
PsiManager.getInstance(project).findFile(virtualFile)
183183
} ?: return null
184+
184185
return runInCli(project, psiFile, args)
185186
}
186187

0 commit comments

Comments
 (0)
Please sign in to comment.