Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version command when retrieving data #227

Merged
merged 5 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/main/kotlin/com/vk/admstorm/admscript/AdmScript.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package com.vk.admstorm.admscript

import com.google.common.cache.Cache
import com.google.common.cache.CacheBuilder
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.project.Project
import com.vk.admstorm.AdmService
import com.vk.admstorm.CommandRunner
import com.vk.admstorm.admscript.utils.DataResponse
import com.vk.admstorm.admscript.utils.DataResponseSerializer
Expand All @@ -28,9 +30,10 @@ abstract class AdmScript<TModel>(private val project: Project) : IService<TModel
protected fun <TModel : Any> execCommand(keyName: String, serializer: KSerializer<TModel>): DataResponse<TModel> {
val workingDir = "${Env.data.projectRoot}/${Env.data.phpSourceFolder}"
val admScriptName = Env.data.admScriptName
val admVersion = PluginManagerCore.getPlugin(AdmService.PLUGIN_ID)?.version ?: "0.0.0"

val baseCommand = "php ${workingDir}/${admScriptName}"
val command = "$baseCommand --method $methodName --key $keyName"
val command = "$baseCommand --method $methodName --key $keyName --version $admVersion"
Danil42Russia marked this conversation as resolved.
Show resolved Hide resolved

var isFromCache = true
val cacheValue = resultCache.getIfPresent(keyName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ abstract class MarkerService<TModel>(project: Project) : AdmScript<TModel>(proje
icon(AllIcons.General.NotificationError)
.gap(RightGap.SMALL)

label(textError)
text(textError)
}
}.apply {
background = JBUI.CurrentTheme.NotificationError.backgroundColor()
Expand Down
Loading