* Define one or more environment variables in the .env file * * @param environmentVariables - Key-value pairs of environment variables * @param options - Configuration options * @param options.omitFromExample - Keys to exclude from .env.example file * * @example * ```ts * awa
(
environmentVariables: T,
options?: { omitFromExample?: Array<keyof T> }
)
| 152 | * ``` |
| 153 | */ |
| 154 | async defineEnvVariables<T extends Record<string, number | string | boolean>>( |
| 155 | environmentVariables: T, |
| 156 | options?: { omitFromExample?: Array<keyof T> } |
| 157 | ) { |
| 158 | const editor = new EnvEditor(this.#app.appRoot) |
| 159 | await editor.load() |
| 160 | |
| 161 | Object.keys(environmentVariables).forEach((key) => { |
| 162 | const value = environmentVariables[key] |
| 163 | editor.add(key, value, options?.omitFromExample?.includes(key)) |
| 164 | }) |
| 165 | |
| 166 | await editor.save() |
| 167 | this.#cliLogger.action('update .env file').succeeded() |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * Returns the TsMorph project instance for advanced AST manipulations. |
no outgoing calls
no test coverage detected