Merge branch 'dev' into add_python_installation

This commit is contained in:
Jeremy Wu 2021-02-04 21:18:57 +11:00
commit 385fabe81b
8 changed files with 51 additions and 46 deletions

View file

@ -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<JsonRPCResult> Result { get; set; }
}

View file

@ -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)
{

View file

@ -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;

View file

@ -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));
}

View file

@ -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

View file

@ -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<Result> RequestUninstall(string search)

View file

@ -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",

View file

@ -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.
[<img width="12px" src="https://user-images.githubusercontent.com/26427004/104119722-9033c600-5385-11eb-9d57-4c376862fd36.png"> **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: <kbd>Alt</kbd>+<kbd>Space</kbd> is the default hotkey.
- Open context menu: <kbd>Ctrl</kbd>+<kbd>O</kbd>/<kbd>Shift</kbd>+<kbd>Enter</kbd>.
- 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 <kbd>Ctrl</kbd>+<kbd>O</kbd>/<kbd>Shift</kbd>+<kbd>Enter</kbd>.
- Cancel/Return to previous screen: <kbd>Esc</kbd>.
- 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-<VersionOfYourFlowLauncher>\UserData`
- Logs are saved along with your user settings folder
- Logs are saved along with your user settings folder.
## Status