| // Copyright (c) The OpenTofu Authors | |
| // SPDX-License-Identifier: MPL-2.0 | |
| // Copyright (c) 2023 HashiCorp, Inc. | |
| // SPDX-License-Identifier: MPL-2.0 | |
| package system | |
| // Config it's just a wrapper that for the moment is used by the command.Meta | |
| // to unify the global system configuration, like env vars, global plugins directory, | |
| // and others. | |
| // | |
| // TODO meta-refactor: once things got cleaned up from Meta, the logic that generates the values | |
| // for the attributes of this struct should be moved to this package. | |
| type Config struct { | |
| // RunningInAutomation indicates that commands are being run by an | |
| // automated system rather than directly at a command prompt. | |
| // | |
| // This is a hint to various command routines that it may be confusing | |
| // to print out messages that suggest running specific follow-up | |
| // commands, since the user consuming the output will not be | |
| // in a position to run such commands. | |
| // | |
| // The intended use-case of this flag is when OpenTofu is running in | |
| // some sort of workflow orchestration tool which is abstracting away | |
| // the specific commands being run. | |
| RunningInAutomation bool | |
| // CLIConfigDir is the directory from which CLI configuration files were | |
| // read by the caller and the directory where any changes to CLI | |
| // configuration files by commands should be made. | |
| // | |
| // If this is empty then no configuration directory is available and | |
| // commands which require one cannot proceed. | |
| CLIConfigDir string | |
| // PluginCacheDir, if non-empty, enables caching of downloaded plugins | |
| // into the given directory. | |
| PluginCacheDir string | |
| // GlobalPluginDirs contains additional paths to search for plugins | |
| GlobalPluginDirs []string | |
| // E2ETestingFeaturesEnabled controls functionality related to replicating | |
| // odd edge cases in OpenTofu, such as programming errors. | |
| E2ETestingFeaturesEnabled bool | |
| } |