Options
All
  • Public
  • Public/Protected
  • All
Menu

Utility to load environment JSON files and set variables

export

Hierarchy

  • EnvFileUtils

Index

Methods

Static getCliHomeEnvironmentFilePath

  • getCliHomeEnvironmentFilePath(appName: string, envPrefix?: string): string
  • Get the expected path for the user's environment variable file

    Parameters

    • appName: string

      The application name

    • Optional envPrefix: string

      The environment variable prefix

    Returns string

    • Returns the path string if it exists, or null if it does not

Static getEnvironmentFilePath

  • getEnvironmentFilePath(appName: string, checkCliHomeVariableFirst?: boolean, envPrefix?: string): string
  • Get the expected path for the user's environment variable file

    Parameters

    • appName: string

      The application name

    • Default value checkCliHomeVariableFirst: boolean = false

      Check inside of *_CLI_HOME first if it is defined

    • Optional envPrefix: string

      environment variable prefix

    Returns string

    • Returns the path string if it exists, or null if it does not

Static getUserHomeEnvironmentFilePath

  • getUserHomeEnvironmentFilePath(appName: string): string

Static setEnvironmentForApp

  • setEnvironmentForApp(appName: string, checkCliHomeVariableFirst?: boolean, envPrefix?: string): void
  • Check and read in an environment file from the user home directory using the app name If the file is valid, set the environment variables If the file is not valid, display an error and continue

    throws

    {ImperativeError}

    Parameters

    • appName: string

      The application name

    • Default value checkCliHomeVariableFirst: boolean = false

      Check inside of *_CLI_HOME first if it is defined

    • Optional envPrefix: string

      The environment variable prefix

    Returns void

Generated using TypeDoc