This commit is contained in:
10
Program.cs
10
Program.cs
@@ -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");
|
||||||
|
|||||||
Reference in New Issue
Block a user