From 348f59b44daf9ce18c665d45ac9d4e97aa5331f8 Mon Sep 17 00:00:00 2001 From: Valerie Date: Thu, 7 Mar 2024 16:27:03 -0500 Subject: [PATCH] the 'FORTUNE_CS_DIR' environment variable now overrides default fortune path --- src/Program.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Program.cs b/src/Program.cs index 2040073..f52239c 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -2,7 +2,10 @@ using System; using System.IO; using System.Security.Cryptography; -var resourcePath = "/usr/share/fortune-cs/"; +// get resource path from var or default +string resourcePath = Environment.GetEnvironmentVariable("FORTUNE_CS_DIR"); +if(resourcePath == "" || !Directory.Exists(resourcePath)) + resourcePath = "/usr/share/fortune-cs/"; // pull file arg if 1 argument is provided string file = null;