EnvFileNaming

Utility for working with environment file naming conventions.

Environment files follow the pattern: env.<name>.<ext> where <name> is the environment name (e.g., "dev", "production") and <ext> is the file extension (e.g., "env", "yaml", "toml").

The special name "global" identifies the global values file.

Functions

Link copied to clipboard
fun buildFilename(environmentName: String, format: EnvFileFormat): String

Constructs a filename from an environment name and format.

Link copied to clipboard

Determines the EnvFileFormat from a filename's extension.

Link copied to clipboard

Extracts the environment name from a filename following the env.<name>.<ext> pattern.

Link copied to clipboard
fun isGlobalFile(filename: String): Boolean

Checks whether the given filename represents a global values file (env.global.<ext>).

Link copied to clipboard

Returns the list of supported file extensions.