From 579d328a9f2fc34e345526fd6c9b4887ec9727b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20K=C3=B6pcke?= Date: Thu, 20 Jun 2024 14:16:12 +0200 Subject: [PATCH] jetbrains.plugins: fix adding JAR plugins --- pkgs/applications/editors/jetbrains/plugins/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/jetbrains/plugins/default.nix b/pkgs/applications/editors/jetbrains/plugins/default.nix index 1fcc8a15a834..11997430f556 100644 --- a/pkgs/applications/editors/jetbrains/plugins/default.nix +++ b/pkgs/applications/editors/jetbrains/plugins/default.nix @@ -106,7 +106,14 @@ in { IFS=' ' read -ra pluginArray <<< "$newPlugins" for plugin in "''${pluginArray[@]}" do - ln -s "$plugin" -t "$out/${rootDir}/plugins/" + pluginfiles=$(ls $plugin); + if [ $(echo $pluginfiles | wc -l) -eq 1 ] && echo $pluginfiles | grep -E "\.jar" 1> /dev/null; then + # if the plugin contains a single jar file, link it directly into the plugins folder + ln -s "$plugin/$(echo $pluginfiles | head -1)" $out/${rootDir}/plugins/ + else + # otherwise link the plugin directory itself + ln -s "$plugin" -t $out/${rootDir}/plugins/ + fi done sed "s|${ide.outPath}|$out|" \ -i $(realpath $out/bin/${meta.mainProgram})