File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
Flow.Launcher.Core/Plugin
Flow.Launcher.Infrastructure
Plugins/Flow.Launcher.Plugin.PluginManagement Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
- using System ;
1
+ using System ;
2
2
using System . Collections . Generic ;
3
3
using System . Linq ;
4
4
using System . IO ;
5
5
using Newtonsoft . Json ;
6
+ using Flow . Launcher . Infrastructure ;
6
7
using Flow . Launcher . Infrastructure . Logger ;
7
8
using Flow . Launcher . Plugin ;
8
9
@@ -11,8 +12,6 @@ namespace Flow.Launcher.Core.Plugin
11
12
12
13
internal abstract class PluginConfig
13
14
{
14
- private const string PluginConfigName = "plugin.json" ;
15
-
16
15
/// <summary>
17
16
/// Parse plugin metadata in the given directories
18
17
/// </summary>
@@ -52,7 +51,7 @@ public static List<PluginMetadata> Parse(string[] pluginDirectories)
52
51
53
52
private static PluginMetadata GetPluginMetadata ( string pluginDirectory )
54
53
{
55
- string configPath = Path . Combine ( pluginDirectory , PluginConfigName ) ;
54
+ string configPath = Path . Combine ( pluginDirectory , Constant . PluginMetadataFileName ) ;
56
55
if ( ! File . Exists ( configPath ) )
57
56
{
58
57
Log . Error ( $ "|PluginConfig.GetPluginMetadata|Didn't find config file <{ configPath } >") ;
Original file line number Diff line number Diff line change 4
4
using ICSharpCode . SharpZipLib . Zip ;
5
5
using Newtonsoft . Json ;
6
6
using Flow . Launcher . Plugin ;
7
+ using Flow . Launcher . Infrastructure ;
7
8
using Flow . Launcher . Infrastructure . Logger ;
8
9
9
10
namespace Flow . Launcher . Core . Plugin
@@ -21,7 +22,7 @@ internal static void Install(string path)
21
22
}
22
23
UnZip ( path , tempFoler , true ) ;
23
24
24
- string iniPath = Path . Combine ( tempFoler , "plugin.json" ) ;
25
+ string iniPath = Path . Combine ( tempFoler , Constant . PluginMetadataFileName ) ;
25
26
if ( ! File . Exists ( iniPath ) )
26
27
{
27
28
MessageBox . Show ( "Install failed: plugin config is missing" ) ;
@@ -95,7 +96,7 @@ internal static void Install(string path)
95
96
96
97
private static PluginMetadata GetMetadataFromJson ( string pluginDirectory )
97
98
{
98
- string configPath = Path . Combine ( pluginDirectory , "plugin.json" ) ;
99
+ string configPath = Path . Combine ( pluginDirectory , Constant . PluginMetadataFileName ) ;
99
100
PluginMetadata metadata ;
100
101
101
102
if ( ! File . Exists ( configPath ) )
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ public static class Constant
8
8
{
9
9
public const string FlowLauncher = "Flow.Launcher" ;
10
10
public const string Plugins = "Plugins" ;
11
+ public const string PluginMetadataFileName = "plugin.json" ;
11
12
12
13
public const string ApplicationFileName = FlowLauncher + ".exe" ;
13
14
Original file line number Diff line number Diff line change 1
- using System ;
1
+ using System ;
2
2
using System . Collections . Generic ;
3
3
using System . IO ;
4
4
using System . Linq ;
@@ -17,7 +17,6 @@ namespace Flow.Launcher.Plugin.PluginManagement
17
17
public class Main : IPlugin , IPluginI18n
18
18
{
19
19
private static string APIBASE = "http://api.wox.one" ;
20
- private static string PluginConfigName = "plugin.json" ;
21
20
private static string pluginSearchUrl = APIBASE + "/plugin/search/" ;
22
21
private const string ListCommand = "list" ;
23
22
private const string InstallCommand = "install" ;
You can’t perform that action at this time.
0 commit comments