mirror of
https://github.com/seriocomedy/ShiftOS-C-.git
synced 2025-01-22 17:22:14 +00:00
Removed Bash :(
This commit is contained in:
parent
65d20ae4aa
commit
0a87d135d6
1 changed files with 44 additions and 15 deletions
|
@ -1561,15 +1561,6 @@ public void cmd_echo(String[] args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cmd_bash(String[] args)
|
|
||||||
{
|
|
||||||
Process p = new Process();
|
|
||||||
p.StartInfo.FileName = "powershell";
|
|
||||||
p.StartInfo.Arguments = "C:\\ShiftOS\\bin\\bash.exe";
|
|
||||||
p.StartInfo.WorkingDirectory = current_dir;
|
|
||||||
p.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void cmd_default(String[] args)
|
public void cmd_default(String[] args)
|
||||||
{
|
{
|
||||||
if (API.OpenProgram(args[0]) == false)
|
if (API.OpenProgram(args[0]) == false)
|
||||||
|
@ -1626,11 +1617,14 @@ public void cmd_default(String[] args)
|
||||||
{
|
{
|
||||||
// This runs EXE Applications like Core Utils
|
// This runs EXE Applications like Core Utils
|
||||||
// Created By Carver Harrison (@carverh)
|
// Created By Carver Harrison (@carverh)
|
||||||
wrongcommand();
|
if (File.Exists("C:\\ShiftOS\\bin\\" + args[0] + ".exe"))
|
||||||
}
|
{
|
||||||
else
|
runExe(args);
|
||||||
{
|
}
|
||||||
wrongcommand();
|
else
|
||||||
|
{
|
||||||
|
wrongcommand();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1666,7 +1660,42 @@ public void cmd_histacom_timedistorter(String[] args)
|
||||||
/// Created By Carver Harrison (@carverh)
|
/// Created By Carver Harrison (@carverh)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="args">string[] args</param>
|
/// <param name="args">string[] args</param>
|
||||||
|
public void runExe(string[] args)
|
||||||
|
{
|
||||||
|
bool isFirstArg = true;
|
||||||
|
string exeArgs = "";
|
||||||
|
foreach (string arg in args)
|
||||||
|
{
|
||||||
|
if (!isFirstArg)
|
||||||
|
{
|
||||||
|
exeArgs = exeArgs + " " + arg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isFirstArg = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
string lp = "C:\\ShiftOS\\bin\\" + args[0] + ".exe";
|
||||||
|
Process p = new Process();
|
||||||
|
p.StartInfo.Arguments = exeArgs;
|
||||||
|
p.StartInfo.UseShellExecute = false;
|
||||||
|
p.StartInfo.RedirectStandardOutput = true;
|
||||||
|
p.StartInfo.RedirectStandardInput = true;
|
||||||
|
p.StartInfo.FileName = lp;
|
||||||
|
p.StartInfo.CreateNoWindow = true;
|
||||||
|
p.StartInfo.ErrorDialog = false;
|
||||||
|
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||||
|
p.StartInfo.WorkingDirectory = current_dir;
|
||||||
|
this.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
p.Start();
|
||||||
|
StreamWriter sw = p.StandardInput;
|
||||||
|
while (!p.HasExited)
|
||||||
|
{
|
||||||
|
txtterm.Text += p.StandardOutput.Read();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void StartChoice1EndStory()
|
private void StartChoice1EndStory()
|
||||||
|
|
Loading…
Reference in a new issue