the 'FORTUNE_CS_DIR' environment variable now overrides default fortune path

This commit is contained in:
Valerie Wolfe 2024-03-07 16:27:03 -05:00
parent dec2f6ff19
commit 348f59b44d

View file

@ -2,7 +2,10 @@ using System;
using System.IO; using System.IO;
using System.Security.Cryptography; 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 // pull file arg if 1 argument is provided
string file = null; string file = null;