From 322673a09fe15c0aa8a5eecb3601fe6a451e22e1 Mon Sep 17 00:00:00 2001 From: Robert Muehsig Date: Thu, 5 Oct 2017 23:27:50 +0200 Subject: [PATCH] cleanup - remove old install --- .../Commands/InstallElectronCommand.cs | 65 ------------------- 1 file changed, 65 deletions(-) delete mode 100644 ElectronNET.CLI/Commands/InstallElectronCommand.cs diff --git a/ElectronNET.CLI/Commands/InstallElectronCommand.cs b/ElectronNET.CLI/Commands/InstallElectronCommand.cs deleted file mode 100644 index 8625dcf..0000000 --- a/ElectronNET.CLI/Commands/InstallElectronCommand.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Threading.Tasks; - -namespace ElectronNET.CLI.Commands -{ - public class InstallElectronCommand : ICommand - { - public const string COMMAND_NAME = "install"; - public const string COMMAND_DESCRIPTION = "install"; - public static IList CommandOptions { get; set; } = new List(); - - private string[] _args; - - public InstallElectronCommand(string[] args) - { - _args = args; - } - - public Task ExecuteAsync() - { - return Task.Run(() => - { - Console.WriteLine("Install Electron Host..."); - - string currentPath = Directory.GetCurrentDirectory(); - string targetPath = Path.Combine(currentPath, "..", "CLIDeploy"); - - Console.WriteLine("Target: " + targetPath); - - if (Directory.Exists(targetPath) == false) - { - Directory.CreateDirectory(targetPath); - } - - EmbeddedFileHelper.DeployEmbeddedFile(targetPath, "main.js"); - EmbeddedFileHelper.DeployEmbeddedFile(targetPath, "package.json"); - EmbeddedFileHelper.DeployEmbeddedFile(targetPath, "package-lock.json"); - - Console.WriteLine("Start npm install..."); - using (Process cmd = new Process()) - { - cmd.StartInfo.FileName = "cmd.exe"; - cmd.StartInfo.RedirectStandardInput = true; - cmd.StartInfo.RedirectStandardOutput = true; - cmd.StartInfo.CreateNoWindow = true; - cmd.StartInfo.UseShellExecute = false; - cmd.StartInfo.WorkingDirectory = targetPath; - - cmd.Start(); - - cmd.StandardInput.WriteLine("npm install"); - cmd.StandardInput.Flush(); - cmd.StandardInput.Close(); - cmd.WaitForExit(); - Console.WriteLine(cmd.StandardOutput.ReadToEnd()); - } - - return true; - }); - } - } -}