mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
make plugin folder name readable.
This commit is contained in:
parent
384b4226f2
commit
32867d3666
1 changed files with 12 additions and 1 deletions
|
|
@ -43,7 +43,17 @@ namespace Wox.Helper
|
|||
Directory.CreateDirectory(pluginFolerPath);
|
||||
}
|
||||
|
||||
string newPluginPath = Path.Combine(pluginFolerPath, Guid.NewGuid().ToString());
|
||||
string newPluginName = plugin.Name
|
||||
.Replace("/", "_")
|
||||
.Replace("\\", "_")
|
||||
.Replace(":", "_")
|
||||
.Replace("<", "_")
|
||||
.Replace(">", "_")
|
||||
.Replace("?", "_")
|
||||
.Replace("*", "_")
|
||||
.Replace("|", "_")
|
||||
+ "-" + Guid.NewGuid();
|
||||
string newPluginPath = Path.Combine(pluginFolerPath,newPluginName);
|
||||
string content = string.Format(
|
||||
"Do you want to install following plugin?\r\n\r\nName: {0}\r\nVersion: {1}\r\nAuthor: {2}",
|
||||
plugin.Name, plugin.Version, plugin.Author);
|
||||
|
|
@ -62,6 +72,7 @@ namespace Wox.Helper
|
|||
{
|
||||
if (existingPlugin != null && Directory.Exists(existingPlugin.Metadata.PluginDirectory))
|
||||
{
|
||||
//when plugin is in use, we can't delete them. That's why we need to make plugin folder a random name
|
||||
File.Create(Path.Combine(existingPlugin.Metadata.PluginDirectory, "NeedDelete.txt")).Close();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue