From 8ae13a54735ef3681657f093c3d06d194b442da6 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Sat, 14 Aug 2021 06:51:11 +0800 Subject: [PATCH] Move working directary setting to init --- Flow.Launcher.Core/Plugin/PythonPlugin.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PythonPlugin.cs b/Flow.Launcher.Core/Plugin/PythonPlugin.cs index 6f43b6df5..5711ed6aa 100644 --- a/Flow.Launcher.Core/Plugin/PythonPlugin.cs +++ b/Flow.Launcher.Core/Plugin/PythonPlugin.cs @@ -36,9 +36,6 @@ namespace Flow.Launcher.Core.Plugin { _startInfo.ArgumentList[2] = request.ToString(); - // todo happlebao why context can't be used in constructor - _startInfo.WorkingDirectory = context.CurrentPluginMetadata.PluginDirectory; - return ExecuteAsync(_startInfo, token); } @@ -54,6 +51,9 @@ namespace Flow.Launcher.Core.Plugin this.context = context; _startInfo.ArgumentList.Add(context.CurrentPluginMetadata.ExecuteFilePath); _startInfo.ArgumentList.Add(""); + + _startInfo.WorkingDirectory = context.CurrentPluginMetadata.PluginDirectory; + return Task.CompletedTask; } }