Skip to content

Commit

Permalink
Minimal version of a setup project
Browse files Browse the repository at this point in the history
  • Loading branch information
Booklordofthedings committed Feb 24, 2025
1 parent 37d04ea commit 0c703ec
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Setup/BeefProj.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FileVersion = 1

[Project]
Name = "Setup"
StartupObject = "Setup.Program"
5 changes: 5 additions & 0 deletions Setup/BeefSpace.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FileVersion = 1
Projects = {Setup = {Path = "."}}

[Workspace]
StartupProject = "Setup"
30 changes: 30 additions & 0 deletions Setup/src/Program.bf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace Setup;

using System;
using System.Diagnostics;

class Program
{
public static void Main()
{
if(AttemptToDownload() case .Ok)
return;
}

public static Result<void> AttemptToDownload()
{
ProcessStartInfo info = scope .();
info.UseShellExecute = false;
info.SetFileNameAndArguments("curl -o sdl3.zip -L https://github.com/libsdl-org/SDL/releases/download/release-3.2.4/SDL3-devel-3.2.4-mingw.zip");

SpawnedProcess p = scope .();
if(p.Start(info) case .Err)
return .Err;

while(!p.HasExited) {}

if(p.ExitCode != 0)
return .Err;
return .Ok;
}
}

0 comments on commit 0c703ec

Please sign in to comment.