Utility to load environment JSON files and set variables

export

### Hierarchy

- EnvFileUtils

## Index

### Properties

- environmentJSON

### Methods

- getCliHomeEnvironmentFilePath
- getEnvironmentFilePath
- getUserHomeEnvironmentFilePath
- resetEnvironmentForApp
- setEnvironmentForApp

## Properties

### Static Private environmentJSON

environmentJSON: any

- Defined in @zowe/imperative/src/utilities/src/EnvFileUtils.ts:29

This variable holds a cached version of the EnvFileJson.

## Methods

### Static getCliHomeEnvironmentFilePath

- getCliHomeEnvironmentFilePath(appName: string, envPrefix?: string): string

- - Defined in @zowe/imperative/src/utilities/src/EnvFileUtils.ts:111

  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

- - Defined in @zowe/imperative/src/utilities/src/EnvFileUtils.ts:81

  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

- - Defined in @zowe/imperative/src/utilities/src/EnvFileUtils.ts:96

  Get the expected path for the user's environment variable file

  #### Parameters

  - ##### appName: string

    The application name

  #### Returns string

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

### Static resetEnvironmentForApp

- resetEnvironmentForApp(): void

- - Defined in @zowe/imperative/src/utilities/src/EnvFileUtils.ts:68

  Reapply environment variables that were applied before

  throws

    {ImperativeError}

  #### Returns void

### Static setEnvironmentForApp

- setEnvironmentForApp(appName: string, checkCliHomeVariableFirst?: boolean, envPrefix?: string): void

- - Defined in @zowe/imperative/src/utilities/src/EnvFileUtils.ts:41

  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