PenningtonBuildMode Pennington.Infrastructure
Detects whether the host is running in static-build mode (CLI verb "build") versus dev-serve mode. Centralized so every call site agrees on the array shape — param-style arrays from Main have the verb at index 0; GetCommandLineArgs has the executable at index 0 and the verb at index 1.
Methods
IsBuildMode
#public static bool IsBuildMode(string[] args);Returns true when args (param-style: verb at index 0) starts with the "build" verb. Use when a caller already has the args array forwarded from Main.
Parameters
argsstring[]
Returns
boolIsBuildMode
#public static bool IsBuildMode();Returns true when the current process was launched with the "build" verb. Reads GetCommandLineArgs, slices off the executable at index 0, and delegates to IsBuildMode. Use from middleware, processors, and other components that don't receive Main's args directly.
Returns
boolPennington.Infrastructure.PenningtonBuildMode
namespace Pennington.Infrastructure;
/// Detects whether the host is running in static-build mode (CLI verb "build") versus dev-serve mode. Centralized so every call site agrees on the array shape — param-style arrays from Main have the verb at index 0; GetCommandLineArgs has the executable at index 0 and the verb at index 1.
public class PenningtonBuildMode
{
/// Returns true when args (param-style: verb at index 0) starts with the "build" verb. Use when a caller already has the args array forwarded from Main.
public static bool IsBuildMode(string[] args);
/// Returns true when the current process was launched with the "build" verb. Reads GetCommandLineArgs, slices off the executable at index 0, and delegates to IsBuildMode. Use from middleware, processors, and other components that don't receive Main's args directly.
public static bool IsBuildMode();
}