diff --git a/Program.cs b/Program.cs index 90771f4..3f1ff07 100644 --- a/Program.cs +++ b/Program.cs @@ -1,9 +1,17 @@ -using System.Text.Json; +using System.Reflection; +using System.Text.Json; using s8n_runtime.ViewModels; string workflowViewFile = Environment.GetEnvironmentVariable("WORKFLOW_FILE")!; 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(File.OpenRead(workflowViewFile), JsonSerializerOptions.Web)!; var edgesFile = Path.Combine("/sources", $"{workflow.Name}.Edges.cs");