public override async Task Delete(string path) { if (!path.IsSet()) { return; } path = path.Replace("/", "\\"); // avoid accident if (path == "\\") { return; } var output = new MemoryOutput(); await Node.ExecuteCommand(new NodeCommand { FileName = "cmd.exe", Arguments = new string[] { "/c", $"del /s /q {path}" }, Output = output, }).CompletedTask; await Node.ExecuteCommand(new NodeCommand { FileName = "cmd.exe", Arguments = new string[] { "/c", $"rmdir /s /q {path}" }, Output = output, }).CompletedTask; return; }
public override async Task <string> FindExecutablePath(string executable) { var output = new MemoryOutput(); await Node.ExecuteCommand(new NodeCommand { FileName = "cmd.exe", Arguments = new string[] { "/c", "where " + executable }, Output = output, }).CompletedTask; return(output.InfoLines.FirstOrDefault()); }
public override async Task <string> GetUsername() { var output = new MemoryOutput(); await Node.ExecuteCommand(new NodeCommand { FileName = "/bin/sh", Arguments = new string[] { "-c", "'cd ~ && pwd'" }, Output = output, }).CompletedTask; return(output.InfoLines.FirstOrDefault()); }
public override async Task Delete(string path) { // avoid accident if (!path.IsSet() || path == "/") { return; } var output = new MemoryOutput(); await Node.ExecuteCommand(new NodeCommand { FileName = "/bin/sh", Arguments = new string[] { "-c", "rm -rf " + path }, Output = output, }).CompletedTask; return; }