initial commit

This commit is contained in:
Booklordofthedings 2024-05-11 17:07:03 +02:00
commit 0300affdfb
4 changed files with 58 additions and 0 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
build/
recovery/
BeefSpace_User.toml

6
BeefProj.toml Normal file
View file

@ -0,0 +1,6 @@
FileVersion = 1
[Project]
Name = "Spill"
TargetType = "BeefGUIApplication"
StartupObject = "Spill.Program"

5
BeefSpace.toml Normal file
View file

@ -0,0 +1,5 @@
FileVersion = 1
Projects = {Spill = {Path = "."}}
[Workspace]
StartupProject = "Spill"

44
src/Program.bf Normal file
View file

@ -0,0 +1,44 @@
using System;
using System.IO;
namespace Spill
{
class Program
{
public static void Main(String[] args)
{
if(!(args.Count > 0))
return; // No fitting argument
if(!Directory.Exists(args[0]))
return; // Wrong argument
String target = Path.GetDirectoryPath(args[0], .. scope .()); // The path we need to move the items to
FileEnumerator f = Directory.EnumerateFiles(args[0]);
for(var i in f)
{
// Construct the target path
String end = scope .(target);
end.Append("/"); // Need this in the middle
end.Append(i.GetFileName(.. scope .()));
Result<void, Platform.BfpFileResult> e = File.Move(i.GetFilePath(.. scope .()),end);
if(e case .Err(let err))
Console.WriteLine(err);
}
FileEnumerator ff = Directory.EnumerateDirectories(args[0]);
for(var i in ff)
{
// Construct the target path
String end = scope .(target);
end.Append("/"); // Need this in the middle
end.Append(i.GetFileName(.. scope .()));
Result<void, Platform.BfpFileResult> e = File.Move(i.GetFilePath(.. scope .()),end);
if(e case .Err(let err))
Console.WriteLine(err);
}
}
}
}