diff --git a/Flow.Launcher.Core/Plugin/JsonPRCModel.cs b/Flow.Launcher.Core/Plugin/JsonPRCModel.cs index 9bc7c2472..247fe1889 100644 --- a/Flow.Launcher.Core/Plugin/JsonPRCModel.cs +++ b/Flow.Launcher.Core/Plugin/JsonPRCModel.cs @@ -15,6 +15,7 @@ using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using Flow.Launcher.Plugin; namespace Flow.Launcher.Core.Plugin @@ -42,6 +43,7 @@ namespace Flow.Launcher.Core.Plugin public class JsonRPCQueryResponseModel : JsonRPCResponseModel { + [JsonPropertyName("result")] public new List Result { get; set; } } diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs index 3d4522498..c7ad70391 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs @@ -147,47 +147,42 @@ namespace Flow.Launcher.Core.Plugin { try { - using (var process = Process.Start(startInfo)) + using var process = Process.Start(startInfo); + if (process == null) { - if (process != null) + Log.Error("|JsonRPCPlugin.Execute|Can't start new process"); + return string.Empty; + } + + using var standardOutput = process.StandardOutput; + var result = standardOutput.ReadToEnd(); + if (string.IsNullOrEmpty(result)) + { + using (var standardError = process.StandardError) { - using (var standardOutput = process.StandardOutput) + var error = standardError.ReadToEnd(); + if (!string.IsNullOrEmpty(error)) { - var result = standardOutput.ReadToEnd(); - if (string.IsNullOrEmpty(result)) - { - using (var standardError = process.StandardError) - { - var error = standardError.ReadToEnd(); - if (!string.IsNullOrEmpty(error)) - { - Log.Error($"|JsonRPCPlugin.Execute|{error}"); - return string.Empty; - } - else - { - Log.Error("|JsonRPCPlugin.Execute|Empty standard output and standard error."); - return string.Empty; - } - } - } - else if (result.StartsWith("DEBUG:")) - { - MessageBox.Show(new Form { TopMost = true }, result.Substring(6)); - return string.Empty; - } - else - { - return result; - } + Log.Error($"|JsonRPCPlugin.Execute|{error}"); + return string.Empty; + } + else + { + Log.Error("|JsonRPCPlugin.Execute|Empty standard output and standard error."); + return string.Empty; } } - else - { - Log.Error("|JsonRPCPlugin.Execute|Can't start new process"); - return string.Empty; - } } + else if (result.StartsWith("DEBUG:")) + { + MessageBox.Show(new Form { TopMost = true }, result.Substring(6)); + return string.Empty; + } + else + { + return result; + } + } catch (Exception e) { diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 26167e945..700a7d509 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -183,6 +183,8 @@ namespace Flow.Launcher.Core.Plugin throw new ArgumentOutOfRangeException(); } token.ThrowIfCancellationRequested(); + if (results == null) + return results; UpdatePluginMetadata(results, metadata, query); metadata.QueryCount += 1; diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 05dbb3a8b..afbe6e197 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -363,7 +363,7 @@ namespace Flow.Launcher.ViewModel } if (!match.IsSearchPrecisionScoreMet()) return false; - + r.Score = match.Score; return true; @@ -512,7 +512,7 @@ namespace Flow.Launcher.ViewModel await Task.Yield(); var results = await PluginManager.QueryForPlugin(plugin, query, currentCancellationToken); - if (!currentCancellationToken.IsCancellationRequested) + if (!currentCancellationToken.IsCancellationRequested && results != null) _resultsUpdateQueue.Post(new ResultsForUpdate(results, plugin.Metadata, query, currentCancellationToken)); } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index 600b573cf..6872f04b4 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -1,10 +1,8 @@ using Flow.Launcher.Infrastructure; using Flow.Launcher.Plugin.SharedCommands; using System; -using System.Diagnostics; using System.IO; using System.Linq; -using System.Runtime.CompilerServices; using System.Windows; namespace Flow.Launcher.Plugin.Explorer.Search diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs index 0f5e6d9e8..881872fc1 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs @@ -3,6 +3,7 @@ using Flow.Launcher.Infrastructure.Http; using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin.PluginsManager.Models; +using Flow.Launcher.Plugin.SharedCommands; using System; using System.Collections.Generic; using System.IO; @@ -327,7 +328,9 @@ namespace Flow.Launcher.Plugin.PluginsManager var zipFilePath = Path.Combine(tempFolderPath, Path.GetFileName(downloadedFilePath)); - File.Move(downloadedFilePath, zipFilePath); + File.Copy(downloadedFilePath, zipFilePath); + + File.Delete(downloadedFilePath); Utilities.UnZip(zipFilePath, tempFolderPluginPath, true); @@ -345,7 +348,9 @@ namespace Flow.Launcher.Plugin.PluginsManager string newPluginPath = Path.Combine(DataLocation.PluginsDirectory, $"{plugin.Name}-{plugin.Version}"); - Directory.Move(pluginFolderPath, newPluginPath); + FilesFolders.CopyAll(pluginFolderPath, newPluginPath); + + Directory.Delete(pluginFolderPath, true); } internal List RequestUninstall(string search) diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json index 75d6038d4..b37a6b1af 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json @@ -6,7 +6,7 @@ "Name": "Plugins Manager", "Description": "Management of installing, uninstalling or updating Flow Launcher plugins", "Author": "Jeremy Wu", - "Version": "1.6.1", + "Version": "1.6.2", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll", diff --git a/README.md b/README.md index ac8611298..9af47a5ee 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,12 @@ Flow Launcher. Dedicated to make your workflow flow more seamlessly. Aimed at be - Search everything from applications, files, bookmarks, YouTube, Twitter and more. All from the comfort of your keyboard without ever touching the mouse. - Search for file contents. -- Support search using environment variable paths +- Support search using environment variable paths. - Run batch and PowerShell commands as Administrator or a different user. - Support languages from Chinese to Italian and more. -- Support of wide range of plugins. +- Support wide range of plugins. +- Prioritise the order of each plugin's results. +- Save file or folder locations for quick access. - Fully portable. [ **SOFTPEDIA EDITOR'S PICK**](https://www.softpedia.com/get/System/Launchers-Shutdown-Tools/Flow-Launcher.shtml) @@ -45,13 +47,14 @@ Windows may complain about security due to code not being signed, this will be c **Usage** - Open flow's search window: Alt+Space is the default hotkey. -- Open context menu: Ctrl+O/Shift+Enter. +- Search programs, bookmarks and control panel items with acronyms eg. `gk` or `gp` for GitKraken Preview; fuzzy search eg. `code` or `vis` for Visual Studio Code. +- Open context menu: on the selected result, press Ctrl+O/Shift+Enter. - Cancel/Return to previous screen: Esc. - Install/Uninstall/Update plugins: in the search window, type `pm install`/`pm uninstall`/`pm update` + the plugin name. - Saved user settings are located: - If using roaming: `%APPDATA%\FlowLauncher` - If using portable, by default: `%localappdata%\FlowLauncher\app-\UserData` -- Logs are saved along with your user settings folder +- Logs are saved along with your user settings folder. ## Status