default
All checks were successful
Build and Test / build-image (push) Successful in 28s

This commit is contained in:
2025-12-31 18:12:18 +03:00
parent c0c4e6413a
commit 104d19eb39

View File

@@ -1,9 +1,17 @@
using System.Text.Json; using System.Reflection;
using System.Text.Json;
using s8n_runtime.ViewModels; using s8n_runtime.ViewModels;
string workflowViewFile = Environment.GetEnvironmentVariable("WORKFLOW_FILE")!; string workflowViewFile = Environment.GetEnvironmentVariable("WORKFLOW_FILE")!;
string projectDirectory = Environment.GetEnvironmentVariable("PROJECT_DIR") ?? $"/sources"; string projectDirectory = Environment.GetEnvironmentVariable("PROJECT_DIR") ?? $"/sources";
if (string.IsNullOrEmpty(workflowViewFile) || !Directory.Exists(projectDirectory))
{
AssemblyName a_name = Assembly.GetExecutingAssembly()!.GetName();
Console.WriteLine("S8N Compiler, version: {0}.\nSpecify environment variables: WORKFLOW_FILE, PROJECT_DIR.\nCLR: {1}", a_name.Version, Environment.Version);
return;
}
var workflow = JsonSerializer.Deserialize<S8nWorkflow>(File.OpenRead(workflowViewFile), JsonSerializerOptions.Web)!; var workflow = JsonSerializer.Deserialize<S8nWorkflow>(File.OpenRead(workflowViewFile), JsonSerializerOptions.Web)!;
var edgesFile = Path.Combine("/sources", $"{workflow.Name}.Edges.cs"); var edgesFile = Path.Combine("/sources", $"{workflow.Name}.Edges.cs");