Skip to content

Commit 5d9c518

Browse files
committed
Try to automatically set instance as executable
1 parent ee16cfe commit 5d9c518

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

common/src/main/kotlin/xyz/bluspring/unitytranslate/translator/LocalLibreTranslateInstance.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ class LocalLibreTranslateInstance private constructor(val process: Process, val
110110

111111
clearDeadDirectories()
112112

113+
if (!source.canExecute()) {
114+
if (!source.setExecutable(true)) {
115+
UnityTranslate.logger.error("Unable to start local LibreTranslate instance! You may have to manually set the execute permission on the file yourself!")
116+
UnityTranslate.logger.error("File path: ${source.absolutePath}")
117+
return
118+
}
119+
}
120+
113121
val processBuilder = ProcessBuilder(listOf(
114122
source.absolutePath,
115123
"--update-models",

0 commit comments

Comments
 (0)