From 3c8d9efdf351114b4e57f928da732c4d3f95f4cd Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 29 May 2018 19:09:41 +0200 Subject: [PATCH] Extract path to 'nice' to a constant (IDEA-CR-32701) --- .../execution/configurations/LowPriorityProcessRunner.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/platform-api/src/com/intellij/execution/configurations/LowPriorityProcessRunner.kt b/platform/platform-api/src/com/intellij/execution/configurations/LowPriorityProcessRunner.kt index 5b0db31c883a..543956723585 100644 --- a/platform/platform-api/src/com/intellij/execution/configurations/LowPriorityProcessRunner.kt +++ b/platform/platform-api/src/com/intellij/execution/configurations/LowPriorityProcessRunner.kt @@ -18,7 +18,7 @@ fun setupLowPriorityExecution(commandLine: GeneralCommandLine, executablePath: S commandLine.parametersList.prependAll("/c", "start", "/b", "/low", "/wait", GeneralCommandLine.inescapableQuote(""), executablePath) } else { - commandLine.exePath = "/usr/bin/nice" + commandLine.exePath = nicePath commandLine.parametersList.prependAll("-n", "10", executablePath) } } @@ -34,4 +34,5 @@ private fun canRunLowPriority(): Boolean { return true } -private val niceExists by lazy { File("/usr/bin/nice").exists() } +private const val nicePath = "/usr/bin/nice" +private val niceExists by lazy { File(nicePath).exists() }