@@ -12,6 +12,8 @@ public class ConsoleData : IData {
1212 public string SavePath { get { return _SavePath ; } set { _SavePath = value ; } }
1313 public static string _DownloadPath ;
1414 public string DownloadPath { get { return _DownloadPath ; } set { _DownloadPath = value ; } }
15+ public static string _Version ;
16+ public string Version { get { return _Version ; } set { _Version = value ; } }
1517 }
1618
1719 public class ExternalScripts : IPlugin {
@@ -23,24 +25,23 @@ public class ExternalScripts : IPlugin {
2325
2426 private List < ICommand > _Commands ;
2527 public List < ICommand > Commands { get { return _Commands ; } set { _Commands = value ; } }
26-
27- public void PluginMain ( ) {
28+
29+ public void PluginInit ( ) {
2830 _data = new ConsoleData ( ) ;
2931
3032 _Commands = new List < ICommand > ( ) ;
3133 _Commands . Add ( new Script ( ) ) ;
3234 _Commands . Add ( new ListScripts ( ) ) ;
3335 _Commands . Add ( new Exec ( ) ) ;
36+ }
37+
38+ public void PluginMain ( ) {
39+ if ( ! Directory . Exists ( Path . Join ( _data . SavePath , "share" , "scripts" ) ) ) {
40+ Console . WriteLine ( "warning: scripts directory does not exist!" ) ;
41+ }
42+ }
3443
35- // TODO SavePath is not set yet, see https://github.com/BoettcherDasOriginal/LeoConsole/issues/12
36- //if (!Directory.Exists(Path.Join(_data.SavePath, "scripts"))) {
37- // Console.WriteLine("creating scripts directory...");
38- // try {
39- // Directory.CreateDirectory(Path.Join(_data.SavePath, "scripts"));
40- // } catch (Exception e) {
41- // Console.WriteLine("WARNING: cannot create scripts dir: " + e.Message);
42- // }
43- //}
44+ public void PluginShutdown ( ) {
4445 }
4546 }
4647}
0 commit comments