Fix bugs in cli
This commit is contained in:
@@ -4,19 +4,18 @@ namespace NubLang.CLI;
|
||||
|
||||
public static class GCC
|
||||
{
|
||||
public static async Task<bool> Assemble(string asm, string objPath)
|
||||
public static async Task<bool> Assemble(string asmPath, string outPath)
|
||||
{
|
||||
var dir = Path.GetDirectoryName(objPath);
|
||||
var dir = Path.GetDirectoryName(outPath);
|
||||
if (dir != null)
|
||||
{
|
||||
Directory.CreateDirectory(dir);
|
||||
}
|
||||
|
||||
using var process = new Process();
|
||||
process.StartInfo = new ProcessStartInfo("gcc", ["-xassembler", "-c", "-o", objPath, "-"])
|
||||
process.StartInfo = new ProcessStartInfo("gcc", ["-xassembler", "-c", "-o", outPath, asmPath])
|
||||
{
|
||||
UseShellExecute = false,
|
||||
RedirectStandardInput = true,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true,
|
||||
CreateNoWindow = true
|
||||
@@ -24,9 +23,6 @@ public static class GCC
|
||||
|
||||
process.Start();
|
||||
|
||||
await process.StandardInput.WriteAsync(asm);
|
||||
process.StandardInput.Close();
|
||||
|
||||
await process.WaitForExitAsync();
|
||||
|
||||
var errors = await process.StandardError.ReadToEndAsync();
|
||||
@@ -50,7 +46,6 @@ public static class GCC
|
||||
process.StartInfo = new ProcessStartInfo("gcc", ["-nostartfiles", "-o", executablePath, ..objectFiles])
|
||||
{
|
||||
UseShellExecute = false,
|
||||
RedirectStandardInput = true,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true,
|
||||
CreateNoWindow = true
|
||||
|
||||
Reference in New Issue
Block a user